(Tkinter) Can I bind a key to Canvas?

Davy zhushenli at gmail.com
Wed Nov 21 05:32:19 CET 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,

More information about the Python-list mailing list