Detect in python which keys are pressed

前端 未结 3 381
太阳男子
太阳男子 2020-11-28 14:11

I need to know which key is being pressed right now. I\'m not looking to capture some specific keys to trigger an event or anything like that,

I want to know which

相关标签:
3条回答
  • 2020-11-28 15:02

    The easiest way to do something like this, if you're not too fussy, is to bring in a GUI toolkit such as pygame or wxPython. For example, run the wxPython Demo, then go to the demo for KeyEvents.

    0 讨论(0)
  • 2020-11-28 15:03

    I found the answer using a link in a related question to pyHook:

    pyHook tutorial: capturing keypress events

    0 讨论(0)
  • 2020-11-28 15:05

    PyKeylogger mentioned in the related question might do the job.

    0 讨论(0)
提交回复
热议问题