I'm writing a game, and I want raw mouse input to control camera (so no
additional acceleration by X server) and don't want mouse to escape the
window (for obvious reasons).<br>I'm using XI_RawMotion events for raw mouse input, and XWarpPointer to not allow mouse escape the window.<br>
Well, the problem is, when XWarpPointer is called, XI_RawMotion is
posted with coordinates of XWarpPointer's target point in screen
coordinates. But it shouldn't - isn't it RAW input?<br>How to do it right?<br>
<br>Minimal test case: <a href="http://pastebin.com/WFJULnYk" target="_blank">http://pastebin.com/WFJULnYk</a><br>(captures RawMotion events, and sends XWarpPointer sometimes).<br>Compile as: "gcc warptest.c -o warptest -lX11 -lXi"<br>
You will see a series of normal events, and then a strange event generated by XWarpPointer.<br><br>Anyway, is there a better method of containing pointer in a window without breaking Alt+Tab (that's what XGrabPointer does)?<br>
Can you also recommend some general best practices with X input for games?<br><br>P.S. Currently using X server 1.8.2 on Arch Linux. (reported to happen on 1.9 as well)<br>