tkinter 3.0 multiple keyboard events together
gagsl-py2 at yahoo.com.ar
Mon Dec 29 06:40:41 CET 2008
En Sun, 28 Dec 2008 06:43:20 -0200, Pavel Kosina <geon at post.cz> escribió:
> well, I am working on a tutorial for youngster (thats why i need to stay
> the code as easy as possible). In this game you are hunted by robots. I
> could use key"7" on numeric keypad for left-up moving but seems to me,
> that "4"+"8" is much more standard for them.
> well, I thought that gui´s have such a problem already built-in - so
> that i am not pressed to code it. You know, its not exactly about me -
> if I do it for myself, for my program, that there is no problem, but I
> need to explained it to begginners ..... And I do not want, as might be
> more usual, do my module, that would cover this "insanity" (look at it
> with 13-years old boy eyes ;-) ). Do you like to say me, that this is
> not a standard "function" neither in tkinter, not say gtk or the others,
I don't recall any application that handles simultaneous keystrokes.
Multiple keystrokes are handled at the library level, but only with regard
to the "modifier" keys (shift, control, alt), so the application sees
Control-P as a *single* synthesized event instead of four.
I'm afraid you'll have to roll your own logic, as your use case isn't very
common. Perhaps treat "4" followed by "8" in quick succession the same as
a fictional event "48" equivalent to "7".
More information about the Python-list