Re: [RFC PATCH 0/6] Input: New EV_BTN event for generic buttons
From: Daniel Campos Ramos
Date: Wed Nov 18 2026 - 10:00:37 EST
Hi Tomasz,
Your EV_BTN series has a home. I carry the six patches as posted in
the kernel of Sparky Stereo OS, my edition of SparkyLinux, in all
three flavours we build (normal, x86-64-v3 and PREEMPT_RT), on 7.3.4.
Your SDL pull request 14758 and your Wine merge request 9853 are in
our SDL and Wine packages beside it.
Thank you for this work. Thanks also to Ivan Gorinov and Ricardo
Esteves, whose patches of December and February went at the same
limit from the other side.
Why I wanted it: more than 80 buttons is ordinary hardware now. Sim
racing and flight cockpits, button boxes, control surfaces and
accessibility devices built from many switches all pass that number.
Linux can be the platform for these, and today it stops at button 80.
What I measured, with a virtual HID joystick (uhid) of 128 buttons,
eight hats and twelve axes:
With the series:
EVIOCGBTNCNT gives 128.
All 128 buttons arrive as EV_BTN, the first 80 also as EV_KEY.
SDL3 with pull request 14758 reads 128 buttons, and so do SDL2
programs through sdl2-compat.
Wine with merge request 9853 gives DirectInput 128 buttons, by
the udev backend and by the SDL bus.
Without the series:
80 buttons as EV_KEY, and SDL reads 79.
Two notes on those results. The SDL number is with one small fix on
top of the pull request: built against kernel headers that have no
EV_BTN, its fallback define never asks the kernel, and SDL stays at
79 buttons. The Wine number needed two small fixes in Wine itself,
outside your merge request. Both belong to those projects and not to
this thread.
One thing for a next version. A report that changes many buttons at
once overflows the evdev client buffer. With all 128 buttons changing
in one report the client received 44 of the 128 EV_BTN events and a
SYN_DROPPED. input_estimate_events_per_packet() makes room for "KEY
and MSC events" with a constant 7 and does not count EV_BTN. Counting
one event per button when the device has EV_BTN gives 128 of 128 and
no SYN_DROPPED here:
/* Make room for KEY and MSC events */
events += 7;
+ /* Every generic button can change in one report */
+ if (test_bit(EV_BTN, dev->evbit))
+ events += dev->button_count;
+
return events;
It only makes sense on top of your patch 2, so take it into the
series if it is useful.
Benjamin's review of patches 3 and 4 reads to me as the way to a
next version. The test device's descriptor and the result tables are
available to anyone who wants them.
I work with AI partners on this distribution. I read and ran what is
reported here and I answer for it.
Daniel Campos Ramos
Sparky Stereo OS
https://github.com/Sparky-OS/sparky-stereo-os