コード例 #1
0
 private void CommandBarOnOnKeyBindDown(GUIBoundKeyEventArgs args)
 {
     if (args.Function == EngineKeyFunctions.TextReleaseFocus)
     {
         Toggle();
         return;
     }
     else if (args.Function == EngineKeyFunctions.TextScrollToBottom)
     {
         Output.ScrollToBottom();
         args.Handle();
     }
     else if (args.Function == EngineKeyFunctions.GuiTabNavigateNext)
     {
         NextCommand();
         args.Handle();
         return;
     }
     else if (args.Function == EngineKeyFunctions.GuiTabNavigatePrev)
     {
         PrevCommand();
         args.Handle();
         return;
     }
 }
コード例 #2
0
        private void CommandBarOnOnKeyDown(GUIKeyEventArgs obj)
        {
            switch (obj.Key)
            {
            case Keyboard.Key.Up:
            {
                obj.Handle();
                var current = CommandBar.Text;
                if (!string.IsNullOrWhiteSpace(current) && _currentCommandEdited)
                {
                    // Block up/down if something is typed in.
                    return;
                }

                if (_historyPosition <= 0)
                {
                    return;
                }

                CommandBar.Text = CommandHistory[--_historyPosition];
                break;
            }

            case Keyboard.Key.Down:
            {
                obj.Handle();
                var current = CommandBar.Text;
                if (!string.IsNullOrWhiteSpace(current) && _currentCommandEdited)
                {
                    // Block up/down if something is typed in.
                    return;
                }

                if (++_historyPosition >= CommandHistory.Count)
                {
                    CommandBar.Text  = "";
                    _historyPosition = CommandHistory.Count;
                    return;
                }

                CommandBar.Text = CommandHistory[_historyPosition];
                break;
            }

            case Keyboard.Key.PageDown:
            {
                obj.Handle();
                Output.ScrollToBottom();
                break;
            }
            }
        }
コード例 #3
0
        private void CommandBarOnOnKeyBindDown(GUIBoundKeyEventArgs args)
        {
            if (args.Function == EngineKeyFunctions.TextReleaseFocus)
            {
                CommandBar.ReleaseKeyboardFocus();
                args.Handle();
                Toggle();
                return;
            }
            else if (args.Function == EngineKeyFunctions.TextHistoryPrev)
            {
                args.Handle();
                var current = CommandBar.Text;
                if (!string.IsNullOrWhiteSpace(current) && _currentCommandEdited)
                {
                    // Block up/down if something is typed in.
                    return;
                }

                if (_historyPosition <= 0)
                {
                    return;
                }

                CommandBar.Text = CommandHistory[--_historyPosition];
            }
            else if (args.Function == EngineKeyFunctions.TextHistoryNext)
            {
                args.Handle();
                var current = CommandBar.Text;
                if (!string.IsNullOrWhiteSpace(current) && _currentCommandEdited)
                {
                    // Block up/down if something is typed in.
                    return;
                }

                if (++_historyPosition >= CommandHistory.Count)
                {
                    CommandBar.Text  = "";
                    _historyPosition = CommandHistory.Count;
                    return;
                }

                CommandBar.Text = CommandHistory[_historyPosition];
            }
            else if (args.Function == EngineKeyFunctions.TextScrollToBottom)
            {
                args.Handle();
                Output.ScrollToBottom();
            }
        }