Skip to content

Instantly share code, notes, and snippets.

@jrgcubano
Created January 29, 2015 10:49
Show Gist options
  • Save jrgcubano/66e267786c79178b6f81 to your computer and use it in GitHub Desktop.
Save jrgcubano/66e267786c79178b6f81 to your computer and use it in GitHub Desktop.
WPF Window System-wide hotkeys
// 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