Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


Using the mouse in X

This topic is 6594 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

How do you go about "grabbing" the mouse point like X11Quake and Quake3 do? Otherwise the mouse just scrolls out the end of the window. Also in quake like games you can keep scrolling left forever. Do they reset the mouse to the middle of the screen each frame? If so how do you do this. I can''t find any function to do this in XLib. Thanks

Share this post

Link to post
Share on other sites
You can grab the pointer using XGrabPointer():

int XGrabPointer(
Display *display,
Window grab_window,
Bool owner_events,
unsigned int event_mask,
int pointer_mode, keyboard_mode,
Window confine_to,
Cursor cursor,
Time time

Now you''ll want to be careful with that as you can easilly
lock up X if yer not careful (when you keep grabbing and never

To ungrab you need to call XUngrabPointer() which gets you
out of grabbing mode.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!