I've always wanted to make a game engine from scratch (well as close to scratch as possible), so I'd rather not mess with anything but the required APIs/libraries. And anyways, I'm getting very close to being done with the X11 stuff, so I've already come too far at this point to switch to something else.
For the Windows version of my game engine, I'm using WM_INPUT and registering the mouse device directly to get the most precise movements. Anyone know how I would go about doing this in X11 (for Linux)? I've searched Google about as thoroughly as I can, but finding good documentation for X11 is next to impossible.
Well in general, no one ever accesses pure X11 for handling this stuff as there are gui libraries out there for this. Have you thought about using a cross OS gui library rather than rolling your own and just wasting time doing that?
My big issue with grabbing the pointer is that it breaks external keyboard shortcuts like Alt+Tab. Also if I'm not careful enough about error checking and a fatal bug occurs, the user could end up trapped and have to restart their machine. I dunno, XGrabPointer just bothers me.It sounds like you're jumping through hoops to reinvent pointer grabbing. You may dislike SDL, but if you're keen on reinventing what it does you might want to look at how it does it.
Thanks, that pointed me in the right direction I think, and I've found a few samples. There is one issue though: Link. That guy's post is the only thing I can find on the internet about this issue, and it hasn't been resolved =\ Can you think of any way to get around that? I was thinking something like sending a certain X event before calling XWarpPointer() and then in my event handler, when I get to the event I sent, ignore the next event, which would be the one sent by XWarpPointer(). Not sure if I'm explaining that right, but does it sound plausible?
I think what you really want to do is read up on XGrabPointer() and it's wife/sister XUngrabPointer(). They're the preferred way to do X11 active pointer grabbing.
Anyways though, the solution I proposed in my last post seems to have worked, so I think I've got it all figured out. Thanks again for pointing me to the XInput extension.