tkinter bug? tk bug?

Michael Bakkemo a at b.c
Sun Nov 3 19:19:29 EST 2002


Yes, it still exhibits the error. I am running on win2k pro, so I cannot
follow up on your suggestion...

grrr.

"Drew Perttula" <drewp at bigasterisk.com> wrote in message
news:18f7875.0211021745.636774fe at posting.google.com...
> "Michael Bakkemo" <a at b.c> wrote in message
news:<apvaej$9ha$0 at 216.39.145.102>...
> > I am not sure where things are going wrong, but binding to the "<Key>"
and
> > "<KeyRelease>" TK events seems to work fine except for the right side
> > control and alt keys: the <Key> event hands me the correct values, but
the
> > <KeyRelease> event hands me the left side values. To wit:
>
> # I made the code a lot shorter. I assume this still exhibits the
> error:
>
> import Tkinter
>
> def KeyDown(ke):
>     print "keydown:", ke.keysym_num, ke.keycode, ke.keysym
>
> def KeyUp(ke):
>     print "keyup:", ke.keysym_num, ke.keycode, ke.keysym
>
> root = Tkinter.Tk()
>
> root.bind("<Key>", KeyDown)
> root.bind("<KeyRelease>", KeyUp)
>
> root.mainloop()
>
> > gives me the following when the right side Alt and Control keys are
pressed
> > and released.
> >
> > >>>
> > keydown: 65514 18 Alt_R
> > keyup: 65513 18 Alt_L
> > keydown: 65508 17 Control_R
> > keyup: 65507 17 Control_L
> >
> >
> > My question is, where (what level) are things going wrong? I doubt it is
my
> > code (but hey, what do I know) tkinter? the tk level? my keyboard
driver?
> >
>
> With the code above, I get good behavior on left and right control,
> alt, and shift. Have you tried the 'xev' utility? That would help you
> separate a
> symbol list typo in tk, etc, from a funny keyboard mapping in your
> windowing
> system.
>
> -Drew





More information about the Python-list mailing list