private void OnHotKeyHandler(HotKey hotkey) { ConfiguredHotKeyViewModel vm = HotKeys.FirstOrDefault(h => h.Shortcut.Id == hotkey.Id); ERole role = vm.Mode == Enums.Modes.Communication ? ERole.eCommunications : ERole.eMultimedia; _audio.SetDefaultDevice(vm.AudioDevice.DeviceId, role); }
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(); } }
public static CaptureMode GetCaptureMode(WindowNative.KeyModifiers modifiers, Keys key) { var hotKey = HotKeys.FirstOrDefault(o => o.Value.Modifiers == modifiers && o.Value.Key == key); return((hotKey.Value != null) ? hotKey.Key : CaptureMode.None); }