GlobalHotKey.HotKeyManager.Register C# (CSharp) Method

Register() public method

Registers the system-wide hot key.
public Register ( Key key, ModifierKeys modifiers ) : System.Windows.Input.HotKey
key Key The key.
modifiers ModifierKeys The key modifiers.
return System.Windows.Input.HotKey
        public HotKey Register(Key key, ModifierKeys modifiers)
        {
            var hotKey = new HotKey(key, modifiers);
            Register(hotKey);
            return hotKey;
        }

Same methods

HotKeyManager::Register ( System.Windows.Input.HotKey hotKey ) : void

Usage Example

 public static void RegisterGlobalHotkey(HotKeyManager hkManager, LoadedGlobalHotkey hotkey)
 {
     if (hotkey.SecondModifierKey != ModifierKeys.None)
     {
         hkManager.Register(hotkey.Hotkey, hotkey.FirstModifierKey | hotkey.SecondModifierKey);
     }
     else
     {
         hkManager.Register(hotkey.Hotkey, hotkey.FirstModifierKey);
     }
 }
All Usage Examples Of GlobalHotKey.HotKeyManager::Register