public Purpose GetHotkey(Key hotkeyId) { int modifier = 0; if (altDown) { modifier |= MOD_ALT; } if (ctrlDown) { modifier |= MOD_CONTROL; } if (winDown) { modifier |= MOD_WIN; } HotkeySignature signature = new HotkeySignature(hotkeyId, modifier); if (this.hotkeys.ContainsKey(signature)) { return(this.hotkeys[signature]); } return(Purpose.None); }
/// <summary>Register the hotkey</summary> public short RegisterGlobalHotkey(Key hotkey, int modifiers, Purpose purpose) { try { HotkeySignature signature = new HotkeySignature(hotkey, modifiers); this.hotkeys.Add(signature, purpose); return(hotkeyCount++); } catch (Exception ex) { // clean up if hotkey registration failed Dispose(); Console.WriteLine(ex); } return(-1); }
/// <summary>Register the hotkey</summary> public short RegisterGlobalHotkey(Key hotkey, int modifiers, Purpose purpose) { try { HotkeySignature signature = new HotkeySignature(hotkey, modifiers); this.hotkeys.Add(signature, purpose); return hotkeyCount++; } catch (Exception ex) { // clean up if hotkey registration failed Dispose(); Console.WriteLine(ex); } return -1; }
public Purpose GetHotkey(Key hotkeyId) { int modifier = 0; if (altDown) { modifier |= MOD_ALT; } if (ctrlDown) { modifier |= MOD_CONTROL; } if (winDown) { modifier |= MOD_WIN; } HotkeySignature signature = new HotkeySignature(hotkeyId, modifier); if (this.hotkeys.ContainsKey(signature)) { return this.hotkeys[signature]; } return Purpose.None; }