public formHotkey() { InitializeComponent(); txtCombo.Text = ImgyazurIcon.Instance.keyComboSettings.ToKeyCombo().ToString(); this.ShortcutHook = new Hook("Shortcut Capture Hook"); this.ShortcutHook.KeyDownEvent += e => { if (txtCombo.Focused) { CurrentKeyCombo = KeyCombo.FromKeyboardHookEventArgs(e); UpdateShortcutDisplay(); } }; }
public ShortcutItemConfiguration() { InitializeComponent(); this.MinimumSize = this.Size; this.ShortcutHook = new Hook("Shortcut Capture Hook"); this.ShortcutHook.KeyDownEvent += e => { if (tbShortcut.Focused) { CurrentKeyCombo = KeyCombo.FromKeyboardHookEventArgs(e); UpdateShortcutDisplay(); } }; lvActions.Select(); }
public void FromKeyCombo(KeyCombo keyCombo) { this["Key"] = keyCombo.Key; this["isCtrlPressed"] = keyCombo.isCtrlPressed; this["isAltPressed"] = keyCombo.isAltPressed; this["isShiftPressed"] = keyCombo.isShiftPressed; this["isWinPressed"] = keyCombo.isWinPressed; }