increasing LED_MAX and INPUT_DEVICE_ID_LED_MAX?

3 messages, 2 authors, 2017-01-03 · open the first message on its own page

increasing LED_MAX and INPUT_DEVICE_ID_LED_MAX?

From: Lars R. Damerow <hidden>
Date: 2016-12-22 21:13:40

Hello,

I'm trying to use a range of P. I. Engineering's X-keys (like this one: http://xkeys.com/xkeys/xk60.php) on Linux.

The XK-60 mostly works when it's plugged in, but buttons on the last four columns don't do anything. I figured out that this is because of how the events get coded in the input system. Button events from the XK-60's generic event device are marked as type EV_LED, and the event code seems to represent the button's column on the device, starting at 10 for the leftmost column.

Since LED_MAX is set to 0x0f, only the first six columns of buttons can report events, and the remaining columns set their code higher than LED_MAX, causing the input system to drop those events.

I patched my kernel to increase LED_MAX and INPUT_DEVICE_ID_LED_MAX to 0x20, and after that all of the XK-60's buttons worked.

Would it be acceptable to make this change upstream, or should this problem be solved a different way (e.g., tweaking the events so that they're EV_KEY instead of EV_LED, though I wouldn't want them to autorepeat)?

Thanks!
-lars

--
lars r. damerow :: button pusher :: pixar animation studios

https://keybase.io/ldamerow
F29F 160D B23C 3237 1BA3 FCD5 4E13 C775 36B3 ABCA

Re: increasing LED_MAX and INPUT_DEVICE_ID_LED_MAX?

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2016-12-28 18:56:19

Hi Lars,

On Thu, Dec 22, 2016 at 1:03 PM, Lars R. Damerow [off-list ref] wrote:
Hello,

I'm trying to use a range of P. I. Engineering's X-keys (like this one: http://xkeys.com/xkeys/xk60.php) on Linux.

The XK-60 mostly works when it's plugged in, but buttons on the last four columns don't do anything. I figured out that this is because of how the events get coded in the input system. Button events from the XK-60's generic event device are marked as type EV_LED, and the event code seems to represent the button's column on the device, starting at 10 for the leftmost column.

Since LED_MAX is set to 0x0f, only the first six columns of buttons can report events, and the remaining columns set their code higher than LED_MAX, causing the input system to drop those events.

I patched my kernel to increase LED_MAX and INPUT_DEVICE_ID_LED_MAX to 0x20, and after that all of the XK-60's buttons worked.

Would it be acceptable to make this change upstream, or should this problem be solved a different way (e.g., tweaking the events so that they're EV_KEY instead of EV_LED, though I wouldn't want them to autorepeat)?
No, we do not want to extend LED range to allow device report buttons
as leds. You need to teach hid-input to parse the descriptors better
for your device.

Thanks.

-- 
Dmitry

Re: increasing LED_MAX and INPUT_DEVICE_ID_LED_MAX?

From: Lars R. Damerow <hidden>
Date: 2017-01-03 20:45:59

From Dmitry Torokhov [off-list ref], Wed, Dec 28, 2016 at 10:56:17AM -0800:
Hi Lars,

No, we do not want to extend LED range to allow device report buttons
as leds. You need to teach hid-input to parse the descriptors better
for your device.
Sounds good. Thanks!
-lars

--
lars r. damerow :: button pusher :: pixar animation studios

https://keybase.io/ldamerow
F29F 160D B23C 3237 1BA3 FCD5 4E13 C775 36B3 ABCA
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help