How can I avoid keyboard conflict in python Tkinter? How can I avoid keyboard conflict in python Tkinter? tkinter tkinter

How can I avoid keyboard conflict in python Tkinter?


Separate the text input from command hotkeys by using a modifier key, like Ctrl:

self.root.bind('<Control-b>',self.buy)self.root.bind('<Control-s>',self.sell)self.root.bind('<Control-B>',self.buy)self.root.bind('<Control-S>',self.sell)

Note that the above has bound both the uppercase and lowercase keys, so that it still works if Caps Lock is on.