예제 #1
0
        public HotKey(HotKeyWrapper hotKeyWrapper)
        {
            CreateHandle(new CreateParams());

            if (hotKeyWrapper != null)
            {
                RegisterHotKey(Handle, 0, hotKeyWrapper.Modifiers, (uint)hotKeyWrapper.KeyCode);
            }
        }
예제 #2
0
        protected override void OnKeyDown(KeyEventArgs e)
        {
            base.OnKeyDown(e);

            e.SuppressKeyPress = true;

            switch (e.KeyCode)
            {
            case Keys.Alt:
            case Keys.Control:
            case Keys.ControlKey:
            case Keys.Shift:
            case Keys.ShiftKey:
            case Keys.Menu:
            case Keys.LWin:
            case Keys.RWin:
            case Keys.HanjaMode:
                return;
            }

            if (e.Alt)
            {
                Text += "Alt + ";
            }

            if (e.Control)
            {
                Text += "Ctrl + ";
            }

            if (e.Shift)
            {
                Text += "Shift + ";
            }

            Text += e.KeyCode.ToString();

            Result = new HotKeyWrapper
            {
                KeyCode   = e.KeyCode,
                KeyString = Text,
                Modifiers = 0
            };

            if (e.Alt)
            {
                Result.Modifiers |= (uint)Modifier.Alt;
            }

            if (e.Control)
            {
                Result.Modifiers |= (uint)Modifier.Control;
            }

            if (e.Shift)
            {
                Result.Modifiers |= (uint)Modifier.Shift;
            }

            editorService.CloseDropDown();
        }
예제 #3
0
 public HotKeyWrapperControl(IWindowsFormsEditorService editorService) : base()
 {
     this.editorService = editorService;
     Result             = new HotKeyWrapper();
 }