Here is a small example of how to create a low level keyboard hook with the Win32 API. Example can be found here.
C#
Related posts