A function callback every time a key is pressed (regardless of which window has focus)?

前端 未结 2 2071
长发绾君心
长发绾君心 2020-12-18 06:43

I want to write a programme (in python) on Linux (Ubuntu Linux 9.10) that will keep track of how many key presses per second/minute I make. This includes normal letter keys,

相关标签:
2条回答
  • 2020-12-18 07:10

    Take a look at what others have done already. You can take a look on how this pykeylogger code handles Linux in its backend, and see if that works for you.

    0 讨论(0)
  • 2020-12-18 07:25

    I'd recommend that you look at the StackOverflow question: Is there a cross-platform python low-level API to capture or generate keyboard events?

    You could also look at the Simple Python Keylogger.

    While not written in Python, you could also look at the LKL Linux KeyLogger. WEB-NES-BAY has instructions for using the LKL Linux KeyLogger.

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