Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8026

Device Tree • Re: gpio-keys, EV_ABS events do fire value !=0 when pressed but not fire value 0 when released

$
0
0
However, there is no event "value 0" when the joystick is released / is in neutral position (also the axis start with a non 0 value (see line 30, 34)).
Judging by the driver, that behaviour appears to be as intended (at least by the writer of the driver. From https://github.com/raspberrypi/linux/bl ... #L382-L387:

Code:

if (type == EV_ABS) {if (state)input_event(input, type, button->code, button->value);} else {input_event(input, type, *bdata->code, state);}
Here you can see that, for EV_ABS controls, the button's value (which is a constant obtained from Device Tree - https://github.com/raspberrypi/linux/bl ... #L770-L771) is passed when the button is pressed, and nothing happens when it is released.

That code has been there for over a decade (https://github.com/raspberrypi/linux/co ... 96c0543749), so it's not something to change in a hurry. However, from reading the dt-bindings, this version does look more correct:

Code:

if (type == EV_ABS) {input_event(input, type, button->code, state ? button->value : 0);} else {input_event(input, type, *bdata->code, state);}
If you feel that the existing implementation is wrong then you're going to have to take it up with the kernel devs. Fortunately it looks like Dmitry Torokhov is still running the input subsystem, although his email address has changed. I'd try messaging Dmitry Torokhov <dmitry.torokhov@gmail.com> and linux-input@vger.kernel.org to ask the question.

Statistics: Posted by PhilE — Tue Oct 15, 2024 8:43 am



Viewing all articles
Browse latest Browse all 8026

Trending Articles