I want to use a Wii Remote as a media controller. There is an X driver that supports this: xf86-input-xwiimote. It maps the arrow keys to normal keyboard arrow keys, A to enter (for activating highlighted buttons), B to space (for playing/pausing media), and some other useful bindings.
How do I do the same thing in Wayland?
What I've found so far:
Simply connecting a Wii remote without configuring it is not good enough. I tried on Gnome Wayland, which uses libinput. libinput detected the remote as a keyboard with only arrow keys. The d-pad works as arrow keys, but no other buttons are detected.
Wii remotes are natively supported in the kernel, but it's the wrong layer for mapping buttons to desktop input. Individual applications can use Wii remotes and other gamepads for input using the kernel interfaces.
This link suggests that X input drivers don't do anything in Wayland, and that Wayland uses libinput instead. It also says that libinput doesn't offer a way to configure devices similar to how devices can be configured in X with .conf files.
I've searched for software similar to xf86-input-xwiimote but for Wayland. As far as I can tell it doesn't exist. If someone were to write something similar, how would that work in the Wayland/libinput stack?