I'm trying to unbind/disable key once it's clicked, and resume its function after 2s. But I can't figure out the code for the unbinding. The bind is on window. Here's the code that I tried so far:
self.choiceA = self.master.bind('a', self.run1) #bind key "a" to run1
def run1(self, event=None):
self.draw_confirmation_button1()
self.master.unbind('a', self.choiceA) #try1: use "unbind", doesn't work
self.choiceA.configure(state='disabled') #try2: use state='disabled', doesn't't work, I assume it only works for button
self.master.after(2000, lambda:self.choiceA.configure(state="normal"))
Further, how can I re-enable the key after 2s?
Thank you so much!