Python Forum

Full Version: Key Binding scope
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
If I bind the return key to a function in my main window can I open a new toplevel window, then bind the return key to a different function, and return to the first function when focus returns to the main window?
Bind the return key to both windows. If window 1 has focus, pressing return will call the function bound to return for window 2 If window 2 has focus, pressing return will call the function for window 2.