Check if key is pressed using python (a daemon in the background)

后端 未结 4 1779
被撕碎了的回忆
被撕碎了的回忆 2020-12-13 22:55

I\'ve created a python script in which an event needs to be executed each time I press the Super (or WinKey) on my keyboard.

How can one achieve this without the pyt

4条回答
  •  眼角桃花
    2020-12-13 23:26

    If you need to work on Linux, I think you need to somehow monitor for X events.

    You can see all events if you run the command "xev" - so I am sure that X provides an interface to all events. A quick googling finds Python X library that probably gives you the stuff you need.

    You can download it here.

提交回复
热议问题