Monitor key presses in Python?

Nobody nobody at nowhere.com
Mon Sep 9 21:33:17 EDT 2013


On Mon, 09 Sep 2013 10:39:43 -0700, eamonnrea wrote:

> Is there a way to detect if the user presses a key in Python that works on
> most OS's? I've only seen 1 method, and that only works in Python 2.6 and
> less.

There's no "generic" solution to this.

At a minimum, there's getting "key presses" from a windowing system and
getting character input from a terminal or console. The two cases are
themselves quite different, and each case has differences between
operating systems.




More information about the Python-list mailing list