You can capture key presses globally, when your application is not on screen or even from the invisible exe silently running in the background.
This demo is an ExeDll program that creates an invisible window and makes the Window server pass all the Left key presses to the program. You can run it on the emulator with the help of ExeLauncher