I'm looking for a utility that confines mouse movement to a certain area (e.g. a window or manually set coordinates). Seemed like a really simple problem, but I haven't found anything that would accomplish it. Note that a couple of programs have the ability to lock the mouse cursor to their own window built-in, mostly emulation software like VirtualBox -- that's exactly what I want, but for other windows.
This question was asked once before, in 2004, with no answer:
http://www.linuxquestions.org/questi...d.php?t=220486
My first thought was to see if Compiz offers anything, and indeed the Enhanced Mouse Zoom plugin lets you zoom in on a window and restrain mouse movement to the "field of vision". This kinda sorta works, but it's not elegant at all, and in fact only works when the window has the same aspect ratio as the screen. I also need to disable my right-hand display (run in TwinView), otherwise the cursor will move off the right side of the screen. And of course, the window is zoomed.
Another thing I found was on the Gentoo wiki:
http://en.gentoo-wiki.com/wiki/HOWTO...in_the_monitor
There's a link to a fairly simple C program which is supposed to confine the cursor to the current screen. Well, first of all this doesn't work for me, assumedly because TwinView registers both displays as one large screen. Apart from that, I assume the code could be adapted to limit movement to an arbitrary rectangle. On the other hand, it seems to work simply by polling, and, if necessary, resetting the position every millisecond, which is far from an elegant approach. The archive contains an executable as well as the code; I couldn't compile the code because I haven't, so far, installed the X development packages.
So yeah. I found numerous people who had the same problem, and I found approximately 100 programs which lock the mouse to a window/region in Windows, but apparently it's not as easy on Linux.
Any help is appreciated.