


este es mi codigo de el keysym no se por que no funciona

Código
from tkinter import * tk = Tk() canvas = Canvas(tk, width=400, height=400) canvas.pack() canvas.create_polygon(10,10,10,60,50,35) def movertriangulo(evento): if event.keysym == 'Up': canvas.move(1,0,-3) elif event.keysym == 'Down': canvas.move(1,0,3) elif event.keysym == 'left': canvas.move(1,-3,0) elif event.keysym == 'Rigth': canvas.move(1,3,3) else: canvas.create_text(200,200,text="No puedes introducir esa tecla!!")
Y estees el de el bind_all que tampoco funciona
Código
from tkinter import * tk = Tk() canvas = Canvas(tk, width=400, height=400) canvas.pack() canvas.create_polygon(10,10,10,60,50,35) def movertriangulo(evento): canvas.move(1,5,0) canvas.bind_all('<KeyPress-Return>',movertriangulo)
ya me di cuenta de los errores
