Tkinter - Can't bind arrow key events

前端 未结 4 1695
梦谈多话
梦谈多话 2020-12-14 17:18

I am trying to bind the left and right arrow keys to an event in Tkinter, but when I run the program it appears the events are not triggering. Here is the code:



        
4条回答
  •  有刺的猬
    2020-12-14 17:57

    It might be that you don't intercept the right events. The arrows on the numeric keypad and the other ones have different symbolic names.

    See http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/key-names.html

    the ones on the numeric keypad are named with a 'KP_' in front.

    Hope it helps. Pardon a newbie if not pertinent :-)

提交回复
热议问题