We're back after a server migration that caused effbot.org to fall over a bit harder than expected. Expect some glitches.

I can't get key bindings to work in Tkinter: why?

An often-heard complaint is that keyboard event handlers bound to events with the bind method don’t get handled even when the appropriate key is pressed.

The most common cause is that the widget to which the binding applies doesn’t have “keyboard focus”. You can use the focus_set method to explicitly move keyboard focus to a widget. Most widgets can also be given keyboard focus by clicking on them (but not labels; see the takefocus option).


CATEGORY: tkinter