Question regarding joystick/gamepad support in wayland

Peter Hutterer peter.hutterer at who-t.net
Wed Mar 2 23:42:58 UTC 2016


On Wed, Mar 02, 2016 at 11:11:06PM +0000, 박성진 wrote:
> Dear all,
> I would like to get your opinions regarding joystick/gamepad support in wayland.
> What's the desirable way to support joystick/gamepad both in wayland and in linux ?
> Plz kindly let me know if there is any previous discussion about this. :)
> 
> Linux supports both joydev(e.g. /dev/input/js0) and evdev(e.g. /dev/input/event0) for joysticks/gamepads.
> As far as I know, many games in linux open js node directly within the process itself and read/handle joystick events by itself.
> Under Xorg window system, without having X events and X input extension events, why are the games opening joystick nodes directly ?
> Are there any reason for doing that ? Are there any performance issues ? Otherwise, is it originated from the lack of X events for joystick?
> Lastly, what the most desirable way to support joysticks/gamepads in wayland ?

couple of things here:
* joystick events require relatively little processing, they are mapped to a
  function and that's about it. compare that with e.g. touchpads where a lot
  of stuff is required before we know whether we should send a motion,
  button or scroll event
* joysticks do not have a standard set of functionality. they're all buttons
  and axes but the layout changes, the functionality differs per device, etc.
  this makes it really hard to come up with a generic library that handles
  joysticks. and when you do, it'll likely look like evdev anyway
* X hasn't really had joystick support, so now you have the inertia of
  "everyone is doing it this way already". Couple this with the fact that
  joysticks aren't used in the normal UI, they're dedicated devices that
  have a different functionality per application.

As for the most desirable way to support joysticks in Wayland - we don't
quite know, it'll depend on developers coming and saying "we need this and
that", then we can start a conversation on what to do. But right now it
seems a logind-like approach to allow an application to open js0 or the
event node is quite sufficient.

Cheers,
   Peter


More information about the wayland-devel mailing list