Example #1
0
        public bool RegisterHotkey(IntPtr handle, Hotkey hotkey)
        {
            var result = HotkeyUtil.RegisterSystemHotKey(handle, hotkey);

            if (result)
            {
                registry.Add(hotkey.Id, hotkey);
            }
            return(result);
        }
Example #2
0
        public bool UnregisterHotkey(IntPtr handle, Hotkey hotkey)
        {
            var result = HotkeyUtil.UnregisterSystemHotKey(handle, hotkey);

            if (result)
            {
                registry.Remove(hotkey.Id);
            }
            return(result);
        }
Example #3
0
 public Hotkey(ClipboardAction action, Keys numberKey)
 {
     Action = action;
     Id     = HotkeyUtil.GetNextHotKeyId();
     if (Action == ClipboardAction.PASTE)
     {
         Modifier = Modifier | HotkeyUtil.ALT_MODIFIER_KEY;
     }
     Number = numberKey;
 }