PDA

View Full Version : Mousecursor positioning with glut



Walantis
03-15-2001, 05:40 AM
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

rts
03-15-2001, 09:22 AM
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.

Walantis
03-15-2001, 01:41 PM
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...

rts
03-15-2001, 01:50 PM
Hey... that's a pretty good reason http://www.opengl.org/discussion_boards/ubb/smile.gif

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

miq
03-18-2001, 02:19 PM
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