You’ll need to make two changes:
-
Add
master.bind('s', self.sharpen)
to
__init__
. (Binding to the Frame,self
, does not seem to work.) -
When s is pressed,
self.sharpen(event)
will be called. Since
Tkinter will be sending aTkinter.Event
object, we must also change the call
signature todef sharpen(self, event=None):
Thus, when the button is pressed,
event
will be set to the default
value,None
, but when the s key is pressed,event
will be assigned to theTkinter.Event
object.