Esempio n. 1
0
            /// <summary>
            /// Visual Studio hooks PreTranslateMessage and will process keyboard input there if it maps to a
            /// command keyboard binding.  Textual input is *not* handled here but keys like Esc, Up, Down, etc ...
            /// are.  They need to be routed directly to IOleCommandTarget
            /// </summary>
            protected override bool PreProcess(KeyDirection keyDirection, KeyInput keyInput, Key key, ModifierKeys modifierKeys)
            {
                // Visual Studio only intercepts the down events.
                if (keyDirection != KeyDirection.Down)
                {
                    return(false);
                }

                switch (keyInput.Key)
                {
                case VimKey.Escape:
                case VimKey.Back:
                case VimKey.Up:
                case VimKey.Down:
                case VimKey.Left:
                case VimKey.Right:
                case VimKey.Tab:
                    return(_vsSimulation.RunInOleCommandTarget(keyInput));

                default:
                    return(false);
                }
            }
Esempio n. 2
0
 protected override bool PreProcess(KeyInput keyInput, Key key, ModifierKeys modifierKeys)
 {
     return(_vsSimulation.RunInOleCommandTarget(keyInput));
 }