Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 5 of 5

Thread: Mousecursor positioning with glut

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2001
    Location
    germany
    Posts
    14

    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

  2. #2
    Member Regular Contributor
    Join Date
    Sep 2000
    Location
    Vancouver BC Canada
    Posts
    418

    Re: Mousecursor positioning with glut

    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.

  3. #3
    Junior Member Newbie
    Join Date
    Mar 2001
    Location
    germany
    Posts
    14

    Re: Mousecursor positioning with glut

    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...

  4. #4
    Member Regular Contributor
    Join Date
    Sep 2000
    Location
    Vancouver BC Canada
    Posts
    418

    Re: Mousecursor positioning with glut

    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.

  5. #5
    Junior Member Newbie
    Join Date
    Sep 2000
    Posts
    16

    Re: Mousecursor positioning with glut

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •