Hi! I wanted to get if a key(Enter/F1/BTN1) was pressed, but it is not working as i thought. :(
So the desired outcome:
- Not to run at start
- Run as many times, as a button was pressed.
So the desired outcome:
import tkinter as tk def pressed_enter(): print('You pressed Enter') def pressed_F1(): print('You pressed F1') def pressed_btn1(): print('Mouse BTN1 was pressed') root = tk.Tk() root.geometry('200x250') root.bind("<Return>", pressed_enter()) root.bind("<KeyPress-F1>", pressed_F1()) root.bind("<Button-1>", pressed_btn1()) root.mainloop()
(Apr-04-2020, 05:10 PM)ifigazsi Wrote: So the desired outcome:
- Not to run at start
- Run as many times, as a button was pressed.