private void PreventMouseHandled(Event e) { if (mouseDownHandled || mouseMoveHandled || mouseUpHandled || MouseDevice.CaptureTarget != null) { e.PreventDefault(); } }
public static bool DispatchEvent(Event @event) { return false; }
private void OnMouseWheel(Event e) { WheelEvent wheelEvent = (WheelEvent)e; Point position = new Point(wheelEvent.PageX, wheelEvent.PageY); int delta = wheelEvent.DeltaY > 0 ? -100 : 100; if (MouseDevice.ProcessRawEvent(new RawMouseWheelEventArgs(delta, position, GetTimestamp()))) { e.PreventDefault(); } }
private void PreventKeyboardHandled(Event e) { if (keyDownHandled || keyUpHandled) { e.PreventDefault(); } }
private void OnMouseMove(Event e) { if (!(e is MouseEvent)) { return; } MouseEvent mouseEvent = (MouseEvent)e; Point position = new Point(mouseEvent.PageX, mouseEvent.PageY); mouseMoveHandled = MouseDevice.ProcessRawEvent(new RawMouseEventArgs(position, GetTimestamp())); if (mouseDownHandled || mouseMoveHandled || MouseDevice.CaptureTarget != null) { e.PreventDefault(); } }
private void OnMouseUp(Event e) { MouseEvent mouseEvent = (MouseEvent)e; Point position = new Point(mouseEvent.PageX, mouseEvent.PageY); MouseButton button = converter.ConvertBackMouseButton(mouseEvent.Button); mouseUpHandled = MouseDevice.ProcessRawEvent(new RawMouseButtonEventArgs(button, MouseButtonState.Released, position, GetTimestamp())); if (mouseDownHandled || mouseMoveHandled || mouseUpHandled || MouseDevice.CaptureTarget != null) { e.PreventDefault(); } }
private void OnKeyUp(Event e) { KeyboardEvent keyboardEvent = (KeyboardEvent)e; Key key = converter.ConvertBackKey(keyboardEvent.KeyCode, keyboardEvent.Location); keyUpHandled = KeyboardDevice.ProcessRawEvent(new RawKeyboardEventArgs(key, KeyStates.None, keyboardEvent.Repeat, GetTimestamp())); if (keyDownHandled || keyUpHandled) { e.PreventDefault(); } }
public bool OnKeyDown(Event jQueryEvent) { foreach (var are in UIAreas) { if (are.OnKeyDown(jQueryEvent)) return true; } return false; }
private void OnContentElementKeyDown(Event e) { if (!IsReadOnly && AcceptsTab && ((KeyboardEvent)e).KeyCode == 9) { int selectionStart = SelectionStart; this.Text = String.Format("{0}\t{1}", this.Text.Substring(0, SelectionStart), this.Text.Substring(SelectionStart + SelectionLength)); ContentElement.HtmlElement.SetSelectionStart(selectionStart + 1); ContentElement.HtmlElement.SetSelectionEnd(selectionStart + 1); GetContentElementSelection(); e.PreventDefault(); } }
public override bool OnKeyDown(Event e) { return false; /* now unsupported if (e.AltKey) return false; if (Focused) { if (e.CtrlKey) { if (e.KeyCode == 65) { DragPosition = 0; CursorPosition = Text.Length; } else if (e.KeyCode == 67) { // _H.copy_to_clipboard(this.text.substring(Math.min(this.cursorPosition, this.dragPosition), Math.max(this.cursorPosition, this.dragPosition))); } else if (e.KeyCode == 88) { // _H.copy_to_clipboard(this.text.substring(Math.min(this.cursorPosition, this.dragPosition), Math.max(this.cursorPosition, this.dragPosition))); Text = Text.Substring(0, Math.Min(CursorPosition, DragPosition)) + Text.Substring(Math.Max(CursorPosition, DragPosition), Text.Length); CursorPosition = Math.Min(CursorPosition, DragPosition); DragPosition = -1; } } else if (e.KeyCode == 37) { if (e.ShiftKey) { if (DragPosition == -1) DragPosition = CursorPosition; CursorPosition = Math.Max(CursorPosition - 1, 0); } else { DragPosition = -1; CursorPosition = Math.Max(CursorPosition - 1, 0); } } else if (e.KeyCode == 39) { if (e.ShiftKey) { if (DragPosition == -1) DragPosition = CursorPosition; CursorPosition = Math.Min(CursorPosition + 1, Text.Length); } else { DragPosition = -1; CursorPosition = Math.Min(CursorPosition + 1, Text.Length); } } else { if (e.KeyCode == 8) { if (DragPosition == -1) Text = Text.Substring(0, CursorPosition - 1) + Text.Substring(CursorPosition, Text.Length); else { Text = Text.Substring(0, Math.Min(CursorPosition, DragPosition)) + Text.Substring(Math.Max(CursorPosition, DragPosition), Text.Length); } if (DragPosition == -1) { if (CursorPosition > 0) CursorPosition--; } else CursorPosition = Math.Min(CursorPosition, DragPosition); } else if (e.KeyCode == 46) { if (DragPosition == -1) Text = Text.Substring(0, CursorPosition) + Text.Substring(Math.Min(CursorPosition + 1, Text.Length), Text.Length); else { Text = Text.Substring(0, Math.Min(CursorPosition, DragPosition)) + Text.Substring(Math.Max(CursorPosition, DragPosition), Text.Length); } if (DragPosition == -1) {} else CursorPosition = Math.Min(CursorPosition, DragPosition); } else { var m = (char) e.KeyCode; var t = String.FromCharCode(m); if (DragPosition == -1) Text = Text.Substring(0, CursorPosition) + t + Text.Substring(CursorPosition, Text.Length); else { Text = Text.Substring(0, Math.Min(CursorPosition, DragPosition)) + t + Text.Substring(Math.Max(CursorPosition, DragPosition), Text.Length); } if (DragPosition == -1) CursorPosition++; else CursorPosition = Math.Max(CursorPosition, DragPosition); } DragPosition = -1; } if (TextChanged != null) TextChanged(); e.PreventDefault(); return true; } return false; */ }
public virtual bool OnKeyDown(Event e) { return false; }