From: Simon Farnsworth <simon.farnsworth@onelan.com>
To: Todd Showalter <todd@electronjump.com>
Cc: David Herrmann <dh.herrmann@gmail.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
"open list:HID CORE LAYER" <linux-input@vger.kernel.org>
Subject: Re: Game Controllers
Date: Fri, 03 May 2013 11:29:25 +0100 [thread overview]
Message-ID: <3024546.hGDLPfhqRN@f17simon> (raw)
In-Reply-To: <CAFmpkygadXbwtyD0Pcc_K4EPqsqRq0EudX=ge6KFoaykR4CHVA@mail.gmail.com>
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
next prev parent reply other threads:[~2013-05-03 11:52 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-27 0:13 Game Controllers Todd Showalter
2013-04-29 21:04 ` Dmitry Torokhov
2013-04-30 0:46 ` Todd Showalter
2013-05-02 6:35 ` Antonio Ospite
2013-05-02 13:46 ` Todd Showalter
2013-05-02 14:09 ` David Herrmann
2013-05-02 15:37 ` Todd Showalter
2013-05-02 16:55 ` Dmitry Torokhov
2013-05-02 15:58 ` Todd Showalter
2013-05-02 16:38 ` Dmitry Torokhov
2013-05-02 17:06 ` Todd Showalter
2013-05-02 18:29 ` Dmitry Torokhov
2013-05-02 19:54 ` Todd Showalter
2013-05-02 20:18 ` Dmitry Torokhov
2013-05-02 20:30 ` Todd Showalter
2013-05-02 20:49 ` Dmitry Torokhov
2013-05-02 17:01 ` Dmitry Torokhov
2013-05-02 17:35 ` Todd Showalter
2013-05-02 17:54 ` David Herrmann
2013-05-02 19:10 ` Todd Showalter
2013-05-02 20:45 ` Dmitry Torokhov
2013-05-02 21:10 ` Todd Showalter
2013-05-03 15:50 ` Dmitry Torokhov
2013-09-07 17:01 ` Bastien Nocera
2013-05-03 10:29 ` Simon Farnsworth [this message]
2013-05-03 12:57 ` Todd Showalter
2013-05-03 16:01 ` Dmitry Torokhov
2013-05-03 17:12 ` Todd Showalter
2013-05-03 22:03 ` Ignaz Forster
2013-05-04 13:48 ` Todd Showalter
2013-05-02 3:25 ` Ray Dillinger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3024546.hGDLPfhqRN@f17simon \
--to=simon.farnsworth@onelan.com \
--cc=dh.herrmann@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=todd@electronjump.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).