FireKeyDown() private method

private FireKeyDown ( KeyEventArgs e ) : void
e KeyEventArgs
return void
コード例 #1
0
        protected override void OnKeyDown(KeyEventArgs e)
        {
            //	So what we're doing here is testing for any of the find/replace
            //	command shortcut bindings. If the key combination matches we send
            //	the KeyEventArgs back to Scintilla so it can be processed. That
            //	way things like Find Next, Show Replace are all available from
            //	the dialog using Scintilla's configured Shortcuts

            List <KeyBinding> findNextBinding    = Scintilla.Commands.GetKeyBindings(BindableCommand.FindNext);
            List <KeyBinding> findPrevBinding    = Scintilla.Commands.GetKeyBindings(BindableCommand.FindPrevious);
            List <KeyBinding> showFindBinding    = Scintilla.Commands.GetKeyBindings(BindableCommand.ShowFind);
            List <KeyBinding> showReplaceBinding = Scintilla.Commands.GetKeyBindings(BindableCommand.ShowReplace);

            KeyBinding kb = new KeyBinding(e.KeyCode, e.Modifiers);

            if (findNextBinding.Contains(kb) || findPrevBinding.Contains(kb) || showFindBinding.Contains(kb) || showReplaceBinding.Contains(kb))
            {
                Scintilla.FireKeyDown(e);
            }

            if (e.KeyCode == Keys.Escape)
            {
                Hide();
            }

            base.OnKeyDown(e);
        }