private void PreventKeyboardHandled(Event e) { if (keyDownHandled || keyUpHandled) { e.PreventDefault(); } }
private void PreventMouseHandled(Event e) { if (mouseDownHandled || mouseMoveHandled || mouseUpHandled || MouseDevice.CaptureTarget != null) { e.PreventDefault(); } }
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 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 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 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(); } }
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(); } }