(Tkinter) Can I bind a key to Canvas?

Davy zhushenli at gmail.com
Tue Nov 20 23:32:19 EST 2007


I have tried key and mouse click (when receive a event, print some
diagnose information ). I found mouse click work well in canvas but
key not work well.

It seems canvas cannot get key event?

        self.canv.bind('<Up>',self._onUpKey) ## don't work
        self.canv.bind('<Button-1>', self._onClick) ## work

Any suggestion?

Best regards,
Davy



More information about the Python-list mailing list