Constraining mouse cursor globally in xorg

2010-01-04 Thread Alex White
Hi,

Not sure if this is the right place for this question, but here goes..

I need to constrain the mouse cursor in xorg, to prevent it reaching an  
area of screen that is not visible to the user (don't ask).

I've noticed that there is support for this within the x server using the  
ConstrainCursor function. What this function provides is exactly what I  
need.

What's not clear to me is how I can access this function from the  
application level. (or is it internal only?). None of the pScreen member  
functions appear to be exposed in the libraries I've searched.

Do I need to write a simple xorg module to do this?

Any suggestions on how to proceed?

Thanks,
Alex.
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: Constraining mouse cursor globally in xorg

2010-01-04 Thread Russell Shaw
Alex White wrote:
 Hi,
 
 Not sure if this is the right place for this question, but here goes..
 
 I need to constrain the mouse cursor in xorg, to prevent it reaching an  
 area of screen that is not visible to the user (don't ask).
 
 I've noticed that there is support for this within the x server using the  
 ConstrainCursor function. What this function provides is exactly what I  
 need.
 
 What's not clear to me is how I can access this function from the  
 application level. (or is it internal only?). None of the pScreen member  
 functions appear to be exposed in the libraries I've searched.
 
 Do I need to write a simple xorg module to do this?
 
 Any suggestions on how to proceed?

How about:
   http://tronche.com/gui/x/xlib/input/XGrabPointer.html
   http://tronche.com/gui/x/xlib/input/XWarpPointer.html

To make it global could be done in the window manager maybe.
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg


Re: Constraining mouse cursor globally in xorg

2010-01-04 Thread Peter Hutterer
On Tue, Jan 05, 2010 at 04:00:48PM +1100, Russell Shaw wrote:
 Alex White wrote:
  Hi,
  
  Not sure if this is the right place for this question, but here goes..
  
  I need to constrain the mouse cursor in xorg, to prevent it reaching an  
  area of screen that is not visible to the user (don't ask).
  
  I've noticed that there is support for this within the x server using the  
  ConstrainCursor function. What this function provides is exactly what I  
  need.
  
  What's not clear to me is how I can access this function from the  
  application level. (or is it internal only?). None of the pScreen member  
  functions appear to be exposed in the libraries I've searched.
  
  Do I need to write a simple xorg module to do this?
  
  Any suggestions on how to proceed?
 
 How about:
http://tronche.com/gui/x/xlib/input/XGrabPointer.html
http://tronche.com/gui/x/xlib/input/XWarpPointer.html
 
 To make it global could be done in the window manager maybe.

Grabbing the pointer would stop event delivery to other clients though and
would only work provided it's a single client that the pointer needs to be
constrained within.

Cheers,
  Peter
___
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg