For a Python project that I'm working on I need to tell the user to insert a character and return its value in ASCII code without having to press enter to commit the key.
It must also read the input only if my program is the active application, otherwise it must do nothing (like getch()
in Windows). The OS is OS X.