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 4 of 4

Thread: Using XWarpPointer in a 'mouselook' interface

  1. #1
    Member Regular Contributor
    Join Date
    Apr 2001
    Location
    Greece
    Posts
    496

    Using XWarpPointer in a 'mouselook' interface

    I'm putting together a mouselook interface where I need to warp the pointer back to the center of the screen whenever it's moved.Problem is that using XWarpPointer causes another MotionNotify event(as if the user moved the mouse to the center of the window) which then re-warps the pointer etc.I need to tell the XServer not to add events to the queue when I issue the XWarpPointer command.Anybody knows how to do that?I've tried XSelectInput But I have problems when I move the mouse with a button pressed so I thought this might not be the way to go.I can't seem to find anything else in the Xlib man pages though.

  2. #2
    Guest

    Re: Using XWarpPointer in a 'mouselook' interface

    If you use XWarpPointer, you will get MotionNotify events as long as they are in your event mask. You could remove MotionNotify from your event mask during the time you do the warp and then put it back.

    I would ignore motion events and instead read the mouse position before warping it back each frame.

  3. #3
    Intern Contributor
    Join Date
    Mar 2002
    Location
    France
    Posts
    53

    Re: Using XWarpPointer in a 'mouselook' interface

    are you speaking about the mouse event under X ? how to use it correctly ? how to know if your mouse has 2 or 3 buttons ? a ruller ...

    ... that's maybe too much asking for me: in this case, just forget that.
    Je suis celui qui failli qui trépasse et se lasse, je suis celui qu'on abuse à vider de sa face

  4. #4
    Member Regular Contributor
    Join Date
    Apr 2001
    Location
    Greece
    Posts
    496

    Re: Using XWarpPointer in a 'mouselook' interface

    No I just had a problem with the X server reporting MoveNotify events although I issued an XSelectInput(None) which should bloack all events,when I did A XWarpPointer.Since I did the warp at every frame to warp to the center the resulting event flooding caused problems.I fixed this though by warping the pointer only when it hits the edge of the screen.This way I get warps rarely and I stil can get relative mouse movements w/o constraining the pointer to the window,sort of...

Posting Permissions

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