I did it differently, but you can give it a try,
gives you the actual intercepted keyboard value. You can create a buffer and add to it in a
. Once in a while you can have IOCTL call from your application and write it to file.