GlobalHotKey.HotKeyManager.Unregister C# (CSharp) Method

Unregister() public method

Unregisters previously registered hot key.
public Unregister ( System.Windows.Input.HotKey hotKey ) : void
hotKey System.Windows.Input.HotKey The registered hot key.
return void
        public void Unregister(HotKey hotKey)
        {
            int id;
            if (_registered.TryGetValue(hotKey, out id))
            {
                WinApi.UnregisterHotKey(_windowHandleSource.Handle, id);
                _registered.Remove(hotKey);
            }
        }

Same methods

HotKeyManager::Unregister ( Key key, ModifierKeys modifiers ) : void

Usage Example

 public static void UnregisterGlobalHotkey(HotKeyManager hkManager, LoadedGlobalHotkey hotkey)
 {
     if (hotkey.SecondModifierKey != ModifierKeys.None)
     {
         hkManager.Unregister(hotkey.Hotkey, hotkey.FirstModifierKey | hotkey.SecondModifierKey);
     }
     else
     {
         hkManager.Unregister(hotkey.Hotkey, hotkey.FirstModifierKey);
     }
 }