More Details On The Proposed Inputfd Protocol For Wayland
A few days ago I wrote about Inputfd as a new Wayland protocol proposal for better supporting gaming devices. Peter Hutterer who drafted the proposal has now released a larger overview on this proposed addition.
Hutterer has written a blog post now to describe this protocol for providing direct access to input devices on Wayland. This "Inputfd" protocol would be used for joysticks and other -- largely gaming focused -- peripherals, rather than implementing APIs for these different devices within libinput itself.
Those wishing to learn more can read Peter's blog post.
Hutterer has written a blog post now to describe this protocol for providing direct access to input devices on Wayland. This "Inputfd" protocol would be used for joysticks and other -- largely gaming focused -- peripherals, rather than implementing APIs for these different devices within libinput itself.
First, what is it? inputfd is a protocol for a Wayland compositor to pass a file descriptor (fd) for an input device directly to the client. The client can then read events off this fd and process them, without any additional buffering in between. In the ideal case, the compositor doesn't care (or even notice) that events are flowing between the kernel and the client. Because the compositor sets up the fd, the client does not need any special privileges.
Why is this needed? There are a few input devices that will not be handled by libinput. libinput is the stack for those devices that have a direct interaction with the desktop - mice, keyboards, touchpads, ... But plenty of devices do not want or require desktop interactions. Joysticks/gamepads are the prime example here, but 3D mice or VR input devices also come to mind. These devices don't control the cursor on the desktop, so the compositor doesn't care about the device's events. Note that the current draft only caters for joysticks, 3D mice etc. are TBD.
Those wishing to learn more can read Peter's blog post.
4 Comments