0

I have a small program that I've written in a console application and I'm wondering if it's possible to have it listen to key events when the program is not focused.

For example if I can run the application and while in a different application if I press and hold the alt key my c# program would register the key event and set a boolean to true when the key is held down.

I did find this https://www.pinvoke.net/default.aspx/user32.registerhotkey but I can't figure out a way for it to detect if a key is held down.

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Festivejelly
  • 670
  • 2
  • 12
  • 30

0 Answers0