Detect in python which keys are pressed Detect in python which keys are pressed python python

Detect in python which keys are pressed


The easiest way to do something like this, if you're not too fussy, is to bring in a GUI toolkit such as pygame or wxPython. For example, run the wxPython Demo, then go to the demo for KeyEvents.