Sep-21-2019, 10:28 PM
Hello,
I have a problem with key control in my tkinter app. After pressing the key ("Enter", →, ←, +, Ctrl+S) I want to do my function. How do I set this control after pressing these keys? For example here is the scheme of the program (not my app):
I have a problem with key control in my tkinter app. After pressing the key ("Enter", →, ←, +, Ctrl+S) I want to do my function. How do I set this control after pressing these keys? For example here is the scheme of the program (not my app):
from tkinter import* app = Tk() def MyFunction(x): #I want to do this after pressing "Enter" print(x) def MyFunction2(y): #I want to do this after pressing "→" y = y + 1 return y def MyFunction3(z): #I want to do this after pressing "Ctrl+S" return z**2 def MyFunction4(a): #I want to do this after pressing "+" print(z*2) app.mainloop()