Question regarding joystick/gamepad support in wayland

Jasper St. Pierre jstpierre at
Thu Mar 3 04:57:57 UTC 2016

There's other reasons, too.

Mice and keyboards need to be demulitplexed --you have one mouse
cursor on the screen, and you can move it between applications. You
select keyboard focus, and the compositor needs to figure out which
window to deliver key events to.

Joypads tend to be exclusive control, with one game majorly in charge.
There's rarely any reason to demultiplex joypad input, so it's
definitely not as strongly needed in the protocol.

There is one reason to perhaps support joypads in Wayland that I see,
and that's simply so the compositor resets your idletime when gamepad
buttons are pressed, but I hope most games would inhibit screensavers

On Wed, Mar 2, 2016 at 3:42 PM, Peter Hutterer <peter.hutterer at> wrote:
> 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
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at


More information about the wayland-devel mailing list