Listen for keypress outside of app

How can I have a custom event be activated by a keyboard press when the standalone game is not in focus?