Re: Game Controllers
From: Simon Farnsworth <hidden>
Date: 2013-05-03 11:52:37
On Thursday 2 May 2013 15:10:55 Todd Showalter wrote:
Users want to plug in a gamepad and have it just work, regardless
of who made it. Developers occasionally want access to he more
esoteric parts of the gamepad hardware, but 99% of the time they just
want standard sticks-and-buttons functionality mapped in a predictable
way.
As a developer, if I had to choose between the current situation
or having all game hardware map down to a standard one-stick, two
button controller with no access to anything else, I'd jump on the
standard controller in a heartbeat. A standard controller means
there's a gigantic pile of crap I don't have to deal with every time I
write a game. It means once a player knows what the NORTH button is,
it's the same in every game and on every controller, regardless of
developer or hardware maker.Could you consider a gamepad equivalent of libv4l2 (source found in http://git.linuxtv.org/v4l-utils.git/tree/HEAD:/lib )? The idea here is a shared library that can be used in two ways: * As an LD_PRELOAD library, for applications that have been designed around a standard device. When used as an LD_PRELOAD, it intercepts open()/ioctl()/close() etc; it passes them through if you're opening something that isn't a V4L2 device, and uses its internal functionality to emulate standard devices atop whatever you've actually got (e.g. doing colour space conversion). * As a genuine shared library, using v4l2_open, v4l2_ioctl etc when working with V4L2 devices. This is a mechanical change to an existing codebase, as the functions provided by libv4l2 behave the same way as the kernel functions do, but add extra functionality like colourspace conversion. A gamepad version would intercept opens of /dev/input/event* nodes, and if that node was a gamepad, do the remapping from gamepad-specific events to the standard gamepad events. You can then use this with unmodified apps as an LD_PRELOAD, or with modified apps as a shared library that only gets in the way if the app is accessing a gamepad. -- Simon Farnsworth Software Engineer ONELAN Ltd http://www.onelan.com