The window that you want to control has to be in focus. Try recording some letters from the keyboard and inputting that into a text file (Bringing the text file to the front).
Unless it's the media controller keys, which are system wide.
I will be adding game controller support soon so that more input keys can be seen as system wide.