1

I was curious what is the MODERN way to catch a global keypress in WPF. I see tons of code samples that are WinForms and much older tech, but where should I be looking for something that works today in WPF.

The goal is to simply kick off an existing method when the Scroll Lock, or other rarely used key, is pressed.

Any advice is appreciated.

Michael Meritt
  • 383
  • 5
  • 18
  • I doubt there's any way to use it that doesn't use interop to set up a global keyboard hook. It should work fine in WPF: http://stackoverflow.com/questions/1639331/using-global-keyboard-hook-wh-keyboard-ll-in-wpf-c-sharp – vesan Aug 31 '16 at 01:52
  • This is the technique I used to achieve similar kind of functionality http://stackoverflow.com/questions/15413172/capture-a-keyboard-keypress-in-the-background – ViVi Aug 31 '16 at 03:05

0 Answers0