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.
相关问题
- How to implement only emoji keyboard for Entry?
- Is there a way to show a number pad (preferably wi
- Advanced error handling: systematically try a rang
- React event handler is not called using jquery val
- X11 forwarding affects Java Swing GUI dropdowns -
相关文章
- How do you detect key up / key down events from a
- Vanilla Web Component custom event attributes and
- Difference Between RoutedEventHandler and EventHan
- How to show the keyboard for a UIView
- Function listener in javascript and/or jQuery
- Android soft keyboard not working
- Why does the escape key have a delay in Python cur
- Can I determine if a KeyEventArg is an letter or n
You can use the XScreenSaver extension (
man Xss
). It can provide you with values into this struct using the functionXScreenSaverQueryInfo
:I don't know about a Qt only solution for this.
look for expectk, it's open source and will provide examples.
I'm not familiar with the guts of the Qt4 or KDE API's.
However in general terms, on any X11 system keyboard or mouse input is only delivered to the active window, unless you call the underlying
XGrabMouse
,XGrabKeyboard
, etc functions.Of course, once you've done that, no other window can receive those input events, so you have to make very sure that there's a way for your program to release the mouse and/or keyboard input once you're done.
Try XRecord (grabing key&mouse is another common solution but it has issues with other applications grabbing).
Here is some link I used some time ago: http://mtoader.blogspot.com/2005/02/you-want-recording-x11-event-recording.html