- Subject: XWarpPointer breaks raw mouse input.
- From: Mad Fish The One <madfishtheone@xxxxxxxxx>
- Date: Tue, 7 Sep 2010 22:43:53 +0300
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).
I'm using XI_RawMotion events for raw mouse input, and XWarpPointer to not allow mouse escape the window.
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?
How to do it right?
Minimal test case: http://pastebin.com/WFJULnYk
(captures RawMotion events, and sends XWarpPointer sometimes).
Compile as: "gcc warptest.c -o warptest -lX11 -lXi"
You will see a series of normal events, and then a strange event generated by XWarpPointer.
Anyway, is there a better method of containing pointer in a window without breaking Alt+Tab (that's what XGrabPointer does)?
Can you also recommend some general best practices with X input for games?
P.S. Currently using X server 1.8.2 on Arch Linux. (reported to happen on 1.9 as well)
_______________________________________________
xorg@xxxxxxxxxxxxxxxxxxxxx: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.freedesktop.org/mailman/listinfo/xorg
Your subscription address: list-xorg@xxxxxxxxxxx
[X Forum]
[Devices]
[XFree86]
[XFree86 Newbie]
[Site Home]
[IETF Annouce]
[Security]
[Fontconfig]
[Bugtraq]
[Photo]
[Yosemite]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Video for Linux]
[Linux RAID]
[Linux Resources]