private void Unregister() { if (_hotKeyValue != 0) { HotKeyUtils.UnregisterKey(this, _hotKeyValue); HotKeyUtils.GlobalDeleteAtom(_hotKeyValue); } }
private bool Register(string key) { Unregister(); var hotKeyValue = HotKeyUtils.GlobalAddAtom("RE:" + key); if (hotKeyValue == 0) { Trace.WriteLine("Could not register atom for hotkey!"); return(false); } return(HotKeyUtils.RegisterKey(this, hotKeyValue, key)); }