Monitor key presses in Python?

Grant Edwards invalid at invalid.invalid
Tue Sep 10 10:18:09 EDT 2013


On 2013-09-09, eamonnrea at gmail.com <eamonnrea at gmail.com> wrote:

> Is there a way to detect if the user presses a key in Python that
> works on most OS's?

No.  Unless by "most OSes" you mean "most Unixes" or "most Windows".

> I've only seen 1 method, and that only works in
> Python 2.6 and less.

> If you get the key, can you store it in a variable?

Sure.

> Also, is there a way to create a callback in Python?

Yes.

-- 
Grant Edwards               grant.b.edwards        Yow! I'm having an
                                  at               EMOTIONAL OUTBURST!!  But,
                              gmail.com            uh, WHY is there a WAFFLE
                                                   in my PAJAMA POCKET??



More information about the Python-list mailing list