[Tkinter-discuss] Focus for first key press

Mark Summerfield mark at qtrac.eu
Thu Jun 21 11:43:38 CEST 2012


On Thu, 21 Jun 2012 10:52:30 +0200
Michael Lange <klappnase at web.de> wrote:
> Hi Mark,
> 
> Thus spoketh Mark Summerfield <list at qtrac.plus.com> 
> unto us on Thu, 21 Jun 2012 08:03:55 +0100:
> 
> > Below is an example. If I do
> > 
> > $ python3 hello.pyw
> > 
> > and then type Alt+F, the File menu does _not_ pop up. If I then type
> > Alt+F a second (or subsequent) time it does.
> > 
> > It seems that Tkinter is ignoring the *very first keypress*. If I press
> > any key (e.g., Space, or x) and _then_ Alt+F, the File menu pops up as
> > it should.
> 
> I cannot reproduce this behavior, here (debian squeeze) the example works
> as expected, so the problem appears to be platform specific.
> Does this happen with "normal" bindings created through bind(), too
> (which might point to some window manager issue) or with menu shortcuts
> only (which might point to the tk magic that handles these behind the
> scenes), and what is the exact platform ?

I'm using Debian stable. I now don't think it is a Tk problem but rather
that my window manager (GNOME 2) is for some reason discarding the first
keypress.

-- 
Mark Summerfield, Qtrac Ltd, www.qtrac.eu
    C++, Python, Qt, PyQt - training and consultancy
        "Advanced Qt Programming" - ISBN 0321635906
            http://www.qtrac.eu/aqpbook.html


More information about the Tkinter-discuss mailing list