/// <summary> /// Set the global hotkey of a display preset. /// </summary> /// <param name="presetName">The display preset name.</param> /// <param name="virtualHotkey">The virtual key code of the global hotkey with modifiers.</param> public void SetHotkey(string presetName, VirtualHotkey virtualHotkey) { // Use the Item property to set the value because if it already exists // we want to overwrite it. mPresetToHotkeyDictionary[presetName] = virtualHotkey; SaveMapping(); OnPresetToHotkeyMappingChanged?.Invoke(presetName, virtualHotkey, PresetToHotkeyMappingChangeType.HotkeySet); }
/// <summary> /// Removes the global hotkey entry for a given display preset name. /// </summary> /// <param name="presetName">The preset name whose hotkey mapping to remove.</param> public void RemoveHotkey(string presetName) { mPresetToHotkeyDictionary.Remove(presetName); SaveMapping(); OnPresetToHotkeyMappingChanged?.Invoke(presetName, new VirtualHotkey(0, 0), PresetToHotkeyMappingChangeType.HotkeyRemoved); }