有没有GetLastInputInfo () 可以在 Linux 中使用的等价物?
目的是检测用户最后一次输入(键盘或鼠标)的时间。 我正在使用 python 编写程序脚本。
最佳答案
XScreenSaverQueryInfo
The idle field specifies the number of milliseconds since the last input was received from the user on any of the input devices. The event-mask field specifies which, if any, screen saver events this client has requested using ScreenSaverSelectInput.
关于python - Linux 中的 GetLastInputInfo 等效于检测上次输入时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2482103/