I am new to tkinter, and I would like to start a kind of loop, from the moment I pressed a key on my keyboard. Only, when I call my first function, I have an error:
TypeError: anime_avancer () missing 1 required positional argument: 'event'.
I understand that there is something to do with the bind method, but I do not understand the structure ... Thank you in advance !
from tkinter import *
fen=Tk()
can=Canvas(fen,bg="light gray", height=500, width=500)
can.pack()
def afficher_codeur():
#code here
anime_avancer()
def anime_avancer(event):
#code here#
afficher_codeur()
fen.bind("<Right>", anime_avancer)
fen.mainloop()
I would like to have explanations on the role of the "event" if possible, thanks ! ;)