Search code examples
c++hookx11hotkeysxserver

Global mouse hook on click events in X11


I've read a lot of information about X11 graphic system and found a lot of questions about this issue without answer. So let me ask onу more time.

I need classic implementation of hook mechanism (like SetWindowsHookEx) or any other approach in UNIX-like operation systems with ONLY ONE CONDITION : ability to listen events without blocking original event (like XGrabButton and XUngrabButton do).

P.S. Ben, this is Danila. I need help! ®


Solution

  • I've ended up by grabbing source code from Xnee - it allows record all input events, including keyboard and mouse with non-blocking logic. The only restriction is that I have to ask if there any events in loop with 100ms interval, but it's ok for me - there is no processor loading at all.