Created
January 29, 2015 10:49
-
-
Save jrgcubano/66e267786c79178b6f81 to your computer and use it in GitHub Desktop.
WPF Window System-wide hotkeys
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Xaml window example code | |
<Window.InputBindings> | |
<KeyBinding Gesture="Ctrl+Alt+Add" Command="{Binding IncrementCommand}" /> | |
<KeyBinding Gesture="Ctrl+Alt+Subtract" Command="{Binding DecrementCommand}" /> | |
</Window.InputBindings> | |
// use globally with NHotkey (https://github.com/thomaslevesque/NHotkey) | |
<Window.InputBindings> | |
<KeyBinding Gesture="Ctrl+Alt+Add" Command="{Binding IncrementCommand}" | |
HotkeyManager.RegisterGlobalHotkey="True" /> | |
<KeyBinding Gesture="Ctrl+Alt+Subtract" Command="{Binding DecrementCommand}" | |
HotkeyManager.RegisterGlobalHotkey="True" /> | |
</Window.InputBindings> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment