in reply to Keyboard capture

You might look at UberKey. It works on linux, and it is very simple c code, maybe you can get it to compile and work on windows. It's free.