Пример #1
0
        public void OnKeyUp(KeyboardEvent e)
        {
            Key key = converter.ConvertBackKey(e.KeyCode, e.Location);

            keyUpHandled = ProcessKeyboardEvent(new RawKeyboardEventArgs(key, KeyStates.None, e.Repeat, GetTimestamp()));

            if (keyDownHandled || keyUpHandled)
            {
                e.PreventDefault();
            }
        }
Пример #2
0
 internal void OnKeyDown(KeyboardEvent e)
 {
     if (e.CtrlKey && e.KeyCode == KeyboardEvent.DOM_VK_Z)
     {
         if (this.undoTree.CanUndo)
         {
             this.undoTree.Undo();
             this.UpdateChildControls();
         }
         e.PreventDefault();
         e.StopPropagation();
     }
     else if (e.CtrlKey && e.KeyCode == KeyboardEvent.DOM_VK_Y)
     {
         if (this.undoTree.CanRedo)
         {
             this.undoTree.Redo();
             this.UpdateChildControls();
         }
         e.PreventDefault();
         e.StopPropagation();
     }
     else if (e.CtrlKey && e.KeyCode == KeyboardEvent.DOM_VK_F)
     {
         FixPosition();
         e.PreventDefault();
         e.StopPropagation();
     }
     else if (e.CtrlKey && (e.KeyCode == KeyboardEvent.DOM_VK_R || e.KeyCode == KeyboardEvent.DOM_VK_M))
     {
         ResetToFixed();
         e.PreventDefault();
         e.StopPropagation();
     }
     else if (e.CtrlKey && e.KeyCode == KeyboardEvent.DOM_VK_U)
     {
         Unfix();
         e.PreventDefault();
         e.StopPropagation();
     }
 }
Пример #3
0
        /// <summary>
        /// Handle key down to the editor.
        /// </summary>
        /// <param name="e">Keyboard event.</param>
        private void onHtmlInputKeyDown_(KeyboardEvent e)
        {
            var htmlInput = FieldTextInput.htmlInput_;
            int tabKey = 9, enterKey = 13, escKey = 27;

            if (e.KeyCode == enterKey)
            {
                WidgetDiv.hide();
            }
            else if (e.KeyCode == escKey)
            {
                htmlInput.Value = htmlInput.DefaultValue;
                WidgetDiv.hide();
            }
            else if (e.KeyCode == tabKey)
            {
                WidgetDiv.hide();
                this.sourceBlock_.tab(this, !e.ShiftKey);
                e.PreventDefault();
            }
        }