Python Forum
Key Binding scope
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Key Binding scope
#1
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?
Reply
#2
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.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Tkinter object scope riversr54 6 1,992 Feb-17-2023, 05:40 AM
Last Post: deanhystad
  kivy binding issue hammer 8 3,036 Nov-07-2021, 11:34 PM
Last Post: hammer
  [Tkinter] binding versus disable DPaul 6 6,787 May-05-2021, 05:17 PM
Last Post: DPaul
  [Tkinter] Binding Entry box to <Button-3> created in for loop iconit 5 4,986 Apr-22-2020, 05:47 AM
Last Post: iconit
  TkInter Binding Buttons ifigazsi 5 4,432 Apr-06-2020, 08:30 AM
Last Post: ifigazsi
  Making text clickable with binding DT2000 10 5,163 Apr-02-2020, 10:11 PM
Last Post: DT2000
  Scope of variable when using two classes AyJay 2 2,177 Jan-23-2020, 10:09 AM
Last Post: AyJay
  [Tkinter] Setting Binding to Entry created with a loop? p_hobbs 1 2,083 Nov-25-2019, 10:29 AM
Last Post: Larz60+
  Binding functions in Qt Designerr Mocap 12 5,929 Aug-22-2019, 03:38 PM
Last Post: Denni
  Binding functions to Menus in tkinter?? Mocap 1 2,471 Jul-23-2019, 01:37 AM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020