Example #1
0
        private void OnKeyDown(object sender, KeyEventArgs e)
        {
            HandledKeyEventArgs args = CreateArgs(e);

            var handler = KeyDown;

            if (handler != null)
            {
                handler(sender, args);
            }

            HandleKeyBindings();
        }
Example #2
0
        private void OnInputKeyDown(object sender, HandledKeyEventArgs e)
        {
            if (e.KeyCode == System.Windows.Forms.Keys.Oemtilde)
            {
                _isOpen = !_isOpen;
                e.Handled = true;
                return;
            }

            if (!_isOpen)
                return;

            if (e.KeyCode == System.Windows.Forms.Keys.Enter)
            {
                ExecuteCommand();
                return;
            }

            if (e.KeyCode == System.Windows.Forms.Keys.Back)
            {
                _cursorText.Remove(_cursorText.Length - 1, 1);
                return;
            }

            _cursorText.Append(e.KeyValue);
        }