vek
April 18th, 2010, 05:58 PM
Greetings. I'm working on an app which traps the mouse cursor in the visible screen(s) for those with multimonitors, to avoid the 'dead zone' problem. I can't seem to find anything that already does that (And searching for 'trap mouse' or 'constrain mouse' comes up with too many unrelated queries.
I've already got a working app that does it at the high level, via mouse polling, XWarpPointer, XQueryPointer, but its just not the right approach to the problem. Relying on polling 'works' but it eats up CPU (sometimes reaching 1 percent!) needlessly and still has flicker.
What I'd like to do is get somewhere in-between the mouse driver and Xorg itself, altering the data before X gets it or at least as part of the event loop so that the mouse data is altered BEFORE it gets sent to the various windows / updates the hardware cursor.
However, my problem with this all is I can't seem to find a good place to start... XLIB seems still too high a level, and expertise on low level X11 / drivery stuff seems to be super rare. I'm finding it difficult to get documentation, and even harder to get the big picture of how the whole data flow between Mouse -> Mouse Driver -> XORG -> WM works.
Is there a good site for finding X11 specific architecture stuff, or documentation of data flows, etc? What source packages should I start looking in? Even just a block diagram of who feeds events to whom would help. Or perhaps a project has already been begun to address this issue and I can join it? Any info would help, I just need some ends to pull at to get this ball unravelled.
I've already got a working app that does it at the high level, via mouse polling, XWarpPointer, XQueryPointer, but its just not the right approach to the problem. Relying on polling 'works' but it eats up CPU (sometimes reaching 1 percent!) needlessly and still has flicker.
What I'd like to do is get somewhere in-between the mouse driver and Xorg itself, altering the data before X gets it or at least as part of the event loop so that the mouse data is altered BEFORE it gets sent to the various windows / updates the hardware cursor.
However, my problem with this all is I can't seem to find a good place to start... XLIB seems still too high a level, and expertise on low level X11 / drivery stuff seems to be super rare. I'm finding it difficult to get documentation, and even harder to get the big picture of how the whole data flow between Mouse -> Mouse Driver -> XORG -> WM works.
Is there a good site for finding X11 specific architecture stuff, or documentation of data flows, etc? What source packages should I start looking in? Even just a block diagram of who feeds events to whom would help. Or perhaps a project has already been begun to address this issue and I can join it? Any info would help, I just need some ends to pull at to get this ball unravelled.