[aquaria] (Help with) tablet support

Giuseppe Bilotta giuseppe.bilotta at gmail.com
Thu Jun 17 11:22:44 EDT 2010


Hello all,

when I got Aquaria from the Humble Indie Bundle I was seriously amazed
by the excellent quality of the graphics and by the sheer length of
the game itself (I'm still plowing through it, btw, so no spoilers
thanks ;-)).

One thing that _did_ annoy me a lot however was my inability to make
use of my graphic tablet as an input device. So when the source code
was finally released, I said to myself: ok, the least I can do is to
add support for this device myself!

What happens with the current code is that when I use my tablet, only
the uppermost left part of the tablet actually seems to trigger some
movements, and additionally the movement is extremely jerky and the
cursor spends most of the time in one of the corners or gliding along
one of the sides of the window.

I'm on Linux, so I decided to add the appropriate code (at least for
the moment) on the SDL side of things, by making use of the XInput
extension to be able to intercept motion (and button press) events
from the tablet and then remapping the tablet coordinates to screen
coordinates. If anybody here has any experience with X + SDL + XInput
programming, I'd really appreciate any suggestions they might have.

My progress so far has been sadly extremely limited: I manage to
detect the tablet if it's attached, I can open the device and register
to listen to the motion and button events from the device (using
XSelectExtensionEvent()) on the root window (I also tried using the
window created  by SDL). I then tried listening to these events via
either XCheckTypedEvent, or by enabling SDL_SYSWMEVENT and see if
anything was intercepted. My surprise was that no XInput event was
captured: the tablet still caused the same jerky motion, and none of
the debug

Does anybody have any suggestion on what I could try next?

-- 
Giuseppe "Oblomov" Bilotta


More information about the aquaria mailing list