[Tkinter-discuss] Tkinter and Alt bindings

Russell Adams RLAdams at AdamsInfoServ.Com
Sat Feb 11 16:06:43 CET 2012

On Sat, Feb 11, 2012 at 12:38:43PM +0100, Michael Lange wrote:
> Hi,
> Thus spoketh Russell Adams <RLAdams at AdamsInfoServ.Com>
> unto us on Fri, 10 Feb 2012 10:35:36 -0600:
> (...)
> >
> > And it works! If I just set the keycode to Super_L, the Alt behavior
> > works properly.
> >
> > I still don't understand why changing Alt_R changes the behavior of
> > Alt_L, but that was exactly the problem. I'd love to figure it out,
> > but I suspect its X11 weirdness. I had originally suspected it was
> > related to Mod1/Alt handling
> >
> > I'll use this for now!
> >
> I'm glad I could help!
> I think the problem is that Tk does not seem to differ between the two
> Alt keys at all; from man bind:
> " Similarly, the Alt modifier refers to whichever modifier is associated
> with the alt key(s) on the keyboard (keysyms Alt_L and Alt_R). "
> So obviously this has to be taken into account when changing xmodmap
> behavior. I am not familiar with xmodmap at all, maybe just defining the
> changes for "keysym" instead of "keycode" in ~/.Xmodmap helps (iirc
> someone suggested this somewhere, I am not sure at all though).
> It is just a guess, but maybe gtk and qt are aware of two different Alt
> keys so the problem does not occur there.

My only concern here is Alt_L was never modified. The xev output of
Alt-s remained the same when Alt_R wasn't changed and when it was.

Of course I was careful not to change the left Alt key everything uses
when I reassigned right Alt to the Windows key...

That's why this issue has been so frustrating, the behavior changed
when the key in question wasn't modified.


Russell Adams                            RLAdams at AdamsInfoServ.com

PGP Key ID:     0x1160DCB3           http://www.adamsinfoserv.com/

Fingerprint:    1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3

More information about the Tkinter-discuss mailing list