Mousecursor positioning with glut

Hi!

How can I set the mouse pointer to a specified position (ie center, of the ogl context) ?

And I want to restrict the mouse pointer in the ogl context, is it possible ?

I use glut for window management…

thanks

glutWarpPointer(int x, int y);

To confine the mouse cursor to the window would probably require some glX and/or Xlib calls that I don’t know off the top of my head. Anyway, I’m not sure why you’d want to do such a thing.

Hi!

thanks for your help!

i use fvwm2 with sloppy focus as wm, thus when i
move the mouse, i sometimes loose the window focus because i moved off the window…

Hey… that’s a pretty good reason

Sorry I don’t know the exact answer, but glX and Xlib is where I’d start looking.

Originally posted by Walantis:

i use fvwm2 with sloppy focus as wm, thus when i
move the mouse, i sometimes loose the window focus because i moved off the window…

Hi,

you can/have to use XGrabPointer. Simply pass it your windows as the confine_to parameter.

hope this helps…

bxe Miq