示例#1
0
        public void HandleKeyDown(InputEventsFilterArgs args, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Enter:
                if (args.InputPosition >= 0)
                {
                    _handleResultAction(KeyInputFilterResult.Input_Submit);
                }
                e.SuppressKeyPress = true;
                break;

            case Keys.Up:
                if (args.InputPosition < 0)
                {
                    _handleResultAction(KeyInputFilterResult.Input_Focus);
                }
                _handleResultAction(KeyInputFilterResult.Input_ShowPreviousHistory);
                e.SuppressKeyPress = true;
                break;

            case Keys.Down:
                if (args.InputPosition < 0)
                {
                    _handleResultAction(KeyInputFilterResult.Input_Focus);
                }
                _handleResultAction(KeyInputFilterResult.Input_ShowNextHistory);
                e.SuppressKeyPress = true;
                break;
            }
        }
示例#2
0
        public void HandleKeyDown(InputEventsFilterArgs args, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Enter:
                _handleResultAction(KeyInputFilterResult.AutoComplete_Submit);
                e.SuppressKeyPress = true;
                break;

            case Keys.Up:
                _handleResultAction(KeyInputFilterResult.Input_Focus);
                _handleResultAction(KeyInputFilterResult.AutoComplete_SelectPrevious);
                e.SuppressKeyPress = true;
                break;

            case Keys.Down:
                _handleResultAction(KeyInputFilterResult.Input_Focus);
                _handleResultAction(KeyInputFilterResult.AutoComplete_SelectNext);
                e.SuppressKeyPress = true;
                break;

            case Keys.Cancel:
                Console.Write("cancel");
                break;
            }
        }
示例#3
0
 public void HandleKeyUp(InputEventsFilterArgs args, KeyEventArgs e)
 {
     switch (e.KeyData)
     {
     case Keys.Tab:
         _handleResultAction(KeyInputFilterResult.AutoComplete_Start);
         e.SuppressKeyPress = true;
         break;
     }
 }
示例#4
0
        public void HandleKeyPress(InputEventsFilterArgs args, KeyPressEventArgs e)
        {
            switch ((int)e.KeyChar)
            {
            case 32:     // space
                _handleResultAction(KeyInputFilterResult.AutoComplete_Submit);
                e.Handled = true;
                break;

            case 27:     // escape
                _handleResultAction(KeyInputFilterResult.AutoComplete_Cancel);
                e.Handled = true;
                break;
            }
        }
        public void HandleKeyDown(InputEventsFilterArgs args, System.Windows.Forms.KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.C:
                if (e.Modifiers == Keys.Control)
                {
                    _handleResultAction(KeyInputFilterResult.Exec_CancelCommandExecution);
                }
                e.SuppressKeyPress = true;
                break;
            }

            e.SuppressKeyPress = true;
        }
        public void HandleKeyPress(InputEventsFilterArgs args, KeyPressEventArgs e)
        {
            if (args.InputPosition < 0)
            {
                e.Handled = true;
                return;
            }

            if (!char.IsLetterOrDigit(e.KeyChar) &&
                !char.IsSeparator(e.KeyChar) &&
                !char.IsPunctuation(e.KeyChar) &&
                !char.IsSymbol(e.KeyChar) &&
                (int)e.KeyChar != 27)    // escape
            {
                // ignore all of this
                e.Handled = true;
            }
        }
        private void HandleKeyPress(InputEventsFilterArgs args, KeyPressEventArgs e)
        {
            EventArgs = new InputEvents()
            {
                KeyPressData = e
            };

            foreach (var filter in _filters.Values)
            {
                if (filter.IsEngaged)
                {
                    filter.HandleKeyPress(args, e);
                    if (e.Handled)
                    {
                        break;
                    }
                }
            }
        }
        public void HandleKeyDown(InputEventsFilterArgs args, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Delete:
                if (args.InputPosition < 0)
                {
                    e.SuppressKeyPress = true;
                }
                break;

            case Keys.Back:
                if (args.InputPosition <= 0)
                {
                    e.SuppressKeyPress = true;
                }
                break;

            case Keys.Left:
                if (args.InputPosition == 0)
                {
                    e.SuppressKeyPress = true;
                }
                break;

            case Keys.Home:
                if (args.InputPosition > 0)
                {
                    if (e.Modifiers == Keys.Shift)
                    {
                        _handleResultAction(KeyInputFilterResult.Input_SelectToStart);
                    }
                    else
                    {
                        _handleResultAction(KeyInputFilterResult.Input_MoveToStart);
                    }
                }
                e.SuppressKeyPress = true;
                break;
            }
        }
示例#9
0
        public void HandleKeyDown(InputEventsFilterArgs args, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Enter:
                if (args.InputPosition >= 0)
                {
                    _handleResultAction(KeyInputFilterResult.Input_CommandExecutionSubmit);
                }
                e.SuppressKeyPress = true;
                break;

            case Keys.Up:
                e.SuppressKeyPress = true;
                break;

            case Keys.Down:
                e.SuppressKeyPress = true;
                break;
            }
        }
 public void HandleKeyUp(InputEventsFilterArgs args, KeyEventArgs e)
 {
 }
示例#11
0
 public void HandleKeyPress(InputEventsFilterArgs args, System.Windows.Forms.KeyPressEventArgs e)
 {
 }
示例#12
0
 public void HandleKeyPress(InputEventsFilterArgs args, KeyPressEventArgs e)
 {
 }
 public void HandleKeyUp(InputEventsFilterArgs args, System.Windows.Forms.KeyEventArgs e)
 {
     e.SuppressKeyPress = true;
 }