Input and games.

John-John Tedro johnjohn.tedro at gmail.com
Sun Apr 21 05:34:44 PDT 2013


As a hobby game dev, what follows is a description of my dream input system.

Apart from the existing input protocol...

I would expect Wayland to support a protocol that can enumerate input
devices and discover capabilities regardless of type. What follows that
wayland has a sensible set of i/o primitives (delta, vector, absolute,
quaternion, buttonset, rumble).
These should be coupled with metadata that makes applications display
sensible information about keybindings (ex. movement format mapped to Left
Stick Y).

The compositor in turn might require a whole slew of drivers (or very few)
to support all the different variations out there under this protocol.
Conflicts and priority needs to be handled since one driver might be very
generic (generic gamepad) while another specialized (Xbox 360 Controller)

Now I have little to no idea how an input model like this would manifest
itself in a library like SDL.

My five cents.


On Sun, Apr 21, 2013 at 2:14 PM, Martin Minarik <
minarik11 at student.fiit.stuba.sk> wrote:

> Hello Todd
>
>
> > That's a complete controller state in 32 bytes. The
> analog values
> > in actual hardware are usually actually returned as
> unsigned byte
> > values, but from a protocol point of view converting
> each stick axis
> > to the range [-1.0f .. 1.0f] and the triggers to [0.0f
> .. 1.0f] is
> > saner.  If Wayland just delivers that data it will cover
> most needs.
>
> I disagree with inventing a new protocol. The joypad
> devices are generally already supported in the linux
> kernel[1].
>
> Pretty much all that device ever does, is to send key and
> abs data.
>
> The protocol is similiar to evdev. We may be able to send
> it over
> the wayland protocol to the applications in a
> straightforward way.
>
> A special device wl_joypad will be created that will
> support button
> and abs axis events. It will be delivered to application
> that subscribe
> to this type of protocol. What do you think?
>
> References:
>
> [1] linux/input/input/joystick/xpad.c
>
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20130421/2e493ddb/attachment.html>


More information about the wayland-devel mailing list