hi!
is there something like windows hooks in linux?
can i use grabMouse for this, or do other apps dont get mouse events than anymore?
hi!
is there something like windows hooks in linux?
can i use grabMouse for this, or do other apps dont get mouse events than anymore?
What are you trying to do?
http://tronche.com/gui/x/xlib/input/...-grabbing.html
http://tronche.com/gui/x/xlib/input/...-grabbing.html
J-P Nurmi
kernel_panic (20th October 2007)
hm this doen't work very fine....
im doing this:
is it wrong?Qt Code:
Window grab_window = oWidget->winId(); Bool owner_events = true; unsigned int event_mask = ButtonPressMask | PointerMotionMask; int pointer_mode = GrabModeAsync, keyboard_mode = GrabModeAsync; Cursor cursor = 0; Time time = CurrentTime; XGrabPointer(display, grab_window, owner_events, event_mask, pointer_mode, keyboard_mode, confine_to, cursor, time);To copy to clipboard, switch view to plain text mode
i call it in a thread.
But what are you trying to achieve? I don't think you have to use the native API here, because Qt handles that. I think the only question is if you really want to grab the pointer.
YEs i really want to grab, but how i do it under windows!
My widget shall get all mouse events, before all other applications get the events.
When the mouse somewhere at the screen was moved, i want to know.
But without freezing the pointer for other widgets. isn't this possible on linux?
If you grab the mouse, no other window (regardless of the application) than the grabbing one will get the event. It's a way to steal events, not to monitor them. Thus my question - what is your goal? Maybe it's enough to reimplement x11Event() and handle some specific event there...
if x11Event is global (for the whole desktop, not only for my app) this is what i need.
i show you what i want to do. This app doesn't act as i want it. i need to know all global mouse events to make it work right.
There surely has to be a way to intercept pending mouse events on X. You might check out KDE sources (specificaly applications like Karm) to see how to do it. You are entering desktop manager specific things here...
There are ways to listen to global events on both Windows and X11. I've done it, but it has been years and I don't remember now what the details are.
this is what i need! please find out or give me a hint. which librarys did you use under linux? xlib?
Here is something to start with: http://lists.freedesktop.org/piperma...ry/020908.html
Bookmarks