Is there a simple way to detect mouse or keyboard activity in Linux/Xorg/Qt4/Kde4?
问题 Is there a simple way to detect mouse or keyboard activity in Linux or Xorg or Qt4 or Kde4 environment? Obviously not only on a particular window but in the entire Xorg desktop. 回答1: You can use the XScreenSaver extension ( man Xss ). It can provide you with values into this struct using the function XScreenSaverQueryInfo : typedef struct { Window window; /∗ screen saver window */ int state; /∗ ScreenSaver{Off,On,Disabled} */ int kind; /∗ ScreenSaver{Blanked,Internal,External} */ unsigned