How to detect that a key is being pressed, not HAS been pressed earlier!??
runed at stud.cs.uit.no
Wed Jan 28 20:03:45 CET 2004
I'm trying to build a gui application and need to know if the user is
actually holding down the shift or ctrl key. That is, if the user
currently is holding down the shift key. In pseudo code this will boil
down to something like this:
if user presses shift:
elif user presses ctrl:
It's important to notice here that I'm not interested if the user has
already pressed shift or ctrl. I'm only interested in knowing if he is
currently holding down one of these keys. (I have looked into msvcrt
and the like but have found no answer..) The function should also work
in both windows and Linux.
Any help is appriciated :)
More information about the Python-list