/// <inheritdoc /> public override void UnregisterHotKey(VirtualKeys key, Modifiers modifiers) { // remove no repeat before adding to list to avoid getting different hash modifiers = (Modifiers)((uint)modifiers & 0xF); KeyModifierCombination combination = new KeyModifierCombination(key, modifiers); if (!HotKeys.ContainsKey(combination)) { String error = $"Failed to unregister hotKey : HotKey \"{key}+{modifiers}\" is not registered"; Logger.Warn(error); throw new HotKeyException(error); } try { HotKey tmpHotKey = HotKeys[combination]; tmpHotKey.UnregisterHotKey(); HotKeysId.Remove(tmpHotKey.Id); HotKeys.Remove(combination); } catch (HotKeyException e) { Logger.Warn("Failed to unregister hotKey : {0}", e.Message); throw; } }
public void RemoveHotKey(HotKey hotKey, bool save = true) { var existing = HotKeys.FirstOrDefault(x => x.HotKey.Equals(hotKey)); if (existing != null) { HotKeys.Remove(existing); } if (save) { Save(); } }
private void DeleteHotKey(ConfiguredHotKeyViewModel vm) { HotKeys.Remove(vm); CloseEditDialog(vm); SaveHotKeysToFile(); }
public bool Remove(string key) { return(HotKeys.Remove(key)); }