View Full Version : Mousecursor positioning with glut
Walantis
03-15-2001, 04: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
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, 12: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...
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.
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
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.