Tutorial :How to monitor for keystrokes pressed when outside the App?


I need a way in C# to monitor system-wide keys such as Ctrl+A, so I can act upon that.

How could I get such an event, even when the keys were pressed with my App no longer in focus?


Have a look at this link : Global System Hooks in .NET


You can use the RegisterHotKey function to react system-wide to hotkeys. However, I wouldn't advise you to use something like Ctrl + A which has a meaning in many applications.


I don't think there's a managed way to do that. At an API level you can register system-wide hooks or global hotkeys.

Writing a keylogger? :-)

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »