I want to bind a Control+1 sequence to a window. widget.bind("<Control-1>", lambda event: someFunction(event))
binds Control + Left Mouse Click. This is the snippet of my code that will use this:
self.master.bind("<Control-1>", lambda event: self.allTypeButtons[1].invoke())
self.master.bind("<Control-2>", lambda event: self.allTypeButtons[2].invoke())
self.master.bind("<Control-3>", lambda event: self.allTypeButtons[3].invoke())
# self.allTypeButtons is a dictionary with Radiobuttons as its values
I also tried self.master.bind("<Control>-1", lambda event: self.allTypeButtons[1].invoke())
, but this gives me: _tkinter.TclError: bad event type or keysym "Control"
.
Also, self.master.bind("Control-1", lambda event: self.allTypeButtons[1].invoke())
and then pressing Control+1 doesn't invoke the event.
I know that widget.bind("1", lambda event: someFunction(event))
binds 1, widget.bind("<1>", lambda event: someFunction(event))
binds Left Mouse Click, and widget.bind("<Control-h>", lambda event: someFunction(event))
binds Control+h, but how can I incorporate Control+1? Thanks in advance.