Absolute minimum code to detect keypresses via mousekeyhook C#

502 Views Asked by At

I want to create a log of keypresses in C#. I found keymousehook but I don't get how to use it. I couldn't find a comprehensive guide or a blog post.

The documentation isn't really helpful either. What is the absolute minimum code to detect keypresses? Can it be used in a Console Application?

1

There are 1 best solutions below

0
On

You might have a look at. This could be used in a console application.

https://github.com/twenzel/SurfacePenNavigator/blob/master/SurfacePenNavigator/KeyboardHook.cs