Python bind - allow multiple keys to be pressed simultaniously

前端 未结 2 1354
遥遥无期
遥遥无期 2020-12-18 09:59

I have a problem in Python.

I\'m using Tkinter and have four bind events, that listen to key presses on my form. My problem is, that these don\'t run asynchronously.

2条回答
  •  醉话见心
    2020-12-18 10:22

    You could bind to "" and then check event.char and perform the action you want based on the value of that? Granted, I have no idea if this works when multiple keys are pressed at the same time, it may still run in to the exact same problem. I haven't used Tk in ages.

    " The user pressed any key. The key is provided in the char member of the event object passed to the callback (this is an empty string for special keys)."

提交回复
热议问题