Input and games.

Rick Yorgason rick at firefang.com
Wed Apr 24 14:03:57 PDT 2013


Todd Showalter <todd at ...> writes:

>     The core of my argument here is that there should be a standard
> gamepad coming through the event system, much like the standard mouse
> does.  The standard gamepad would be: <snip>

For reference, in the Windows XP days joystick input was done with
DirectInput, which was designed to be as flexible as possible, work with any
input device, and even went as far as to let you query human-readable names
for devices and buttons.

Now they've deprecated DirectInput for the much simpler XInput, which lays
out the controller like so:

http://msdn.microsoft.com/en-ca/library/windows/desktop/microsoft.directx_sdk.reference.xinput_gamepad%28v=vs.85%29.aspx

That's a nice set of buttons/axes to use as a standard abstraction, although
it would be nice if they had built that on top of DirectInput's flexibility.
Having a sane default configuration is great, but in XInput it comes at the
cost of not allowing players to customize their controls to support more
exotic hardware. It would be amazing if Wayland/evdev was designed around
this middle-ground.

One thing I would expect a joystick abstraction to do that I don't expect a
mouse abstraction to do is, if I plug two mice into a system I expect them
both to control the same cursor, but with joysticks I always want to know
which joystick is sending each message.

(By the way, I like Todd's north/east/south/west abstraction for the face
buttons. It's probably also safe to abstract start/back into
startnext/backselect. XInput notably does not allow access to the home
button, and even on Linux it would probably be bad form for games to use the
home button, but a low-level protocol would need to define it so it could be
used for things like Steam's Big Picture or media centre compositors.)



More information about the wayland-devel mailing list