Fwd: [PATCH 3/3] evdev: Don't post REL_MISC events as axis motion. (#24737)

Bartosz Brachaczek b.brachaczek at gmail.com
Fri Aug 13 05:12:41 PDT 2010


Actually this REL_MISC event doesn't affect x/y motion, at least for
me, as long as the bug fixed by patches 1, 2 is fixed (though Bartek
Iwaniec had problems with it, see
https://bugs.freedesktop.org/show_bug.cgi?id=24737#c19). The problem
caused by REL_MISC is described in this comment:
https://bugs.freedesktop.org/show_bug.cgi?id=24737#c29.

Anyway, you can see that REL_MISC events sent by this device are
obviously wrong and confusing:

# ./evtest /dev/input/event6
Input driver version is 1.0.0
Input device ID: bus 0x3 vendor 0x9da product 0xe version 0x110
Input device name: "A4Tech PS/2+USB Mouse"
Supported events:
 Event type 0 (Sync)
 Event type 1 (Key)
   Event code 272 (LeftBtn)
   Event code 273 (RightBtn)
   Event code 274 (MiddleBtn)
   Event code 275 (SideBtn)
   Event code 276 (ExtraBtn)
   Event code 277 (ForwardBtn)
   Event code 278 (BackBtn)
   Event code 279 (TaskBtn)
 Event type 2 (Relative)
   Event code 0 (X)
   Event code 1 (Y)
   Event code 8 (Wheel)
   Event code 9 (Misc)
 Event type 4 (Misc)
   Event code 4 (ScanCode)
Grab succeeded, ungrabbing.
Testing ... (interrupt to exit)
Event: time 1281700496.957417, type 4 (Misc), code 4 (ScanCode), value 90001
Event: time 1281700496.957419, type 1 (Key), code 272 (LeftBtn), value 1
Event: time 1281700496.957421, type 2 (Relative), code 9 (Misc), value 8
Event: time 1281700496.957422, -------------- Report Sync ------------
Event: time 1281700497.061417, type 4 (Misc), code 4 (ScanCode), value 90001
Event: time 1281700497.061420, type 1 (Key), code 272 (LeftBtn), value 0
Event: time 1281700497.061422, type 2 (Relative), code 9 (Misc), value 8
Event: time 1281700497.061423, -------------- Report Sync ------------
Event: time 1281700501.973438, type 4 (Misc), code 4 (ScanCode), value 90002
Event: time 1281700501.973440, type 1 (Key), code 273 (RightBtn), value 1
Event: time 1281700501.973442, type 2 (Relative), code 9 (Misc), value 8
Event: time 1281700501.973443, -------------- Report Sync ------------
Event: time 1281700502.125445, type 4 (Misc), code 4 (ScanCode), value 90002
Event: time 1281700502.125447, type 1 (Key), code 273 (RightBtn), value 0
Event: time 1281700502.125449, type 2 (Relative), code 9 (Misc), value 8
// till this moment I was only clicking buttons, no motion; below is some motion
Event: time 1281700502.125450, -------------- Report Sync ------------
Event: time 1281700515.917507, type 2 (Relative), code 0 (X), value 1
Event: time 1281700515.917510, type 2 (Relative), code 9 (Misc), value 8
Event: time 1281700515.917511, -------------- Report Sync ------------
Event: time 1281700515.925532, type 2 (Relative), code 9 (Misc), value 8
Event: time 1281700515.925534, -------------- Report Sync ------------
Event: time 1281700515.933494, type 2 (Relative), code 0 (X), value 2
Event: time 1281700515.933496, type 2 (Relative), code 9 (Misc), value 8
Event: time 1281700515.933496, -------------- Report Sync ------------
Event: time 1281700515.941496, type 2 (Relative), code 0 (X), value 1
Event: time 1281700515.941498, type 2 (Relative), code 9 (Misc), value 8
Event: time 1281700515.941499, -------------- Report Sync ------------
Event: time 1281700515.949496, type 2 (Relative), code 0 (X), value 2
Event: time 1281700515.949498, type 2 (Relative), code 1 (Y), value -1
Event: time 1281700515.949499, type 2 (Relative), code 9 (Misc), value 8
Event: time 1281700515.949500, -------------- Report Sync ------------
Event: time 1281700515.957495, type 2 (Relative), code 0 (X), value 1
Event: time 1281700515.957497, type 2 (Relative), code 9 (Misc), value 8
Event: time 1281700515.957498, -------------- Report Sync ------------
Event: time 1281700515.965503, type 2 (Relative), code 9 (Misc), value 8
Event: time 1281700515.965505, -------------- Report Sync ------------
Event: time 1281700515.973505, type 2 (Relative), code 0 (X), value 2
Event: time 1281700515.973509, type 2 (Relative), code 9 (Misc), value 8
Event: time 1281700515.973510, -------------- Report Sync ------------
Event: time 1281700515.981509, type 2 (Relative), code 9 (Misc), value 8
Event: time 1281700515.981512, -------------- Report Sync ------------
Event: time 1281700515.997508, type 2 (Relative), code 1 (Y), value -2
Event: time 1281700515.997511, type 2 (Relative), code 9 (Misc), value 8
Event: time 1281700515.997512, -------------- Report Sync ------------
Event: time 1281700516.005506, type 2 (Relative), code 0 (X), value 1
Event: time 1281700516.005509, type 2 (Relative), code 9 (Misc), value 8
Event: time 1281700516.005510, -------------- Report Sync ------------
Event: time 1281700516.013504, type 2 (Relative), code 0 (X), value 2
Event: time 1281700516.013508, type 2 (Relative), code 9 (Misc), value 8
Event: time 1281700516.013509, -------------- Report Sync ------------
Event: time 1281700516.021506, type 2 (Relative), code 9 (Misc), value 8
Event: time 1281700516.021510, -------------- Report Sync ------------
Event: time 1281700516.029508, type 2 (Relative), code 9 (Misc), value 8
Event: time 1281700516.029511, -------------- Report Sync ------------


Maybe kernel should have a quirk for this device?

Cheers,
Bartosz


2010/8/13 Peter Hutterer <peter.hutterer at who-t.net>:
> On Tue, Aug 10, 2010 at 10:32:08PM +0200, Bartosz Brachaczek wrote:
>> Some devices, notably A4Tech X-750F, send unknown events with non-zero
>> value after almost every other event which kernel interprets as REL_MISC.
>> It results in a motion event sent between all key press/release events,
>> which is incorrect and may unnecessarily trigger drag'n'drop actions.
>>
>> X.Org Bug 24737 <http://bugs.freedesktop.org/show_bug.cgi?id=24737>
>>
>> Signed-off-by: Bartosz Brachaczek <b.brachaczek at gmail.com>
>> Tested-by: Bartek Iwaniec <hash87 at gmail.com>
>> ---
>>  src/evdev.c |    5 ++++-
>>  1 files changed, 4 insertions(+), 1 deletions(-)
>>
>> diff --git a/src/evdev.c b/src/evdev.c
>> index 31fe1d6..ca9dc6f 100644
>> --- a/src/evdev.c
>> +++ b/src/evdev.c
>> @@ -500,7 +500,10 @@ EvdevProcessRelativeMotionEvent(InputInfoPtr
>> pInfo, struct input_event *ev)
>>                  EvdevQueueButtonClicks(pInfo, wheel_left_button, -value);
>>              break;
>>
>> -        /* We don't post wheel events as axis motion. */
>> +        case REL_MISC:
>> +            break;
>> +
>> +        /* We don't post wheel/misc events as axis motion. */
>>          default:
>>              /* Ignore EV_REL events if we never set up for them. */
>>              if (!(pEvdev->flags & EVDEV_RELATIVE_EVENTS))
>> --
>> 1.7.2
>
> Can you provide the evtest or evtest-capture output for such a device?
> REL_MISC should just be handled as another axis and if it's non-zero, it
> should not affect x/y motion.
>
> I merged the other two, will push after a bit of testing.
>
> Cheers,
>  Peter
>


More information about the xorg-devel mailing list