Skip to content

Commit

Permalink
added unmodifiable (fall-back) hotkey
Browse files Browse the repository at this point in the history
  • Loading branch information
srushti committed Aug 13, 2009
1 parent a5675a7 commit 8824354
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Azazel/MainWindowCommand.cs
Expand Up @@ -12,6 +12,7 @@ public class MainWindowCommand {
private WPFHotkeyManager hotkeyManager;
private readonly MainWindowController controller;
private MainWindow window;
private readonly Hotkey unchangeableDisplayHotkey = new Hotkey(Modifiers.Alt | Modifiers.Control | Modifiers.Shift, Keys.Space);

public MainWindowCommand(VoidDelegate killApplication, AppSettings settings) {
var selfPlugin = new SelfPlugin();
Expand Down Expand Up @@ -40,6 +41,7 @@ public class MainWindowCommand {
hotkeyManager = new WPFHotkeyManager(window);
hotkeyManager.Register(displayHotkey);
hotkeyManager.Register(killHotkey);
hotkeyManager.Register(unchangeableDisplayHotkey);
hotkeyManager.HotkeyPressed += (window1, hotkey) => HandleHotkey(hotkey);
}

Expand All @@ -48,10 +50,11 @@ public class MainWindowCommand {
window.Close();
hotkeyManager.Unregister(displayHotkey);
hotkeyManager.Unregister(killHotkey);
hotkeyManager.Unregister(unchangeableDisplayHotkey);
if (hotkey.Equals(displayHotkey)) Execute();
else if (hotkey.Equals(killHotkey)) killApplication();
}
if (hotkey.Equals(displayHotkey)) window.Activate();
if (hotkey.Equals(displayHotkey) || hotkey.Equals(unchangeableDisplayHotkey)) window.Activate();
}
}

Expand Down

0 comments on commit 8824354

Please sign in to comment.