I have a WPF application (prism) that uses many other WPF collections and even win32 dlls containing other windows (wpf and win32).
When the user presses a function key (F2-F12), I want to open the special functions of the program.
Something like that:
RoutedCommand commandF4 = new RoutedCommand(); commandF4.InputGestures.Add(new KeyGesture(Key.F4)); Application.Current.MainWindow.CommandBindings.Add(new CommandBinding(commandF4, CallCommandF4));
The problem is this: it only works if MainWindow has focus. If I open a secondary WPF window (or win32 window), the key binding is no longer applied.
Is there a way to add a global application hotkey for F4 (or some other key)?
Or at least the WPF hotkey?
source share