• I
    HID: fix incorrect handling of devices with high button count · f8e86d05
    Ingo Ruhnke 提交于
    Button names for USB gamepads are currently assigned incorrectly, as the evdev
    code assigned to buttons is "BTN_GAMEPAD + code", which on devices with more
    then 16 buttons bleeds over into button names reserved for graphic tablets
    (BTN_TOOL_PEN, etc.). This causes problems further down the line as the device
    are now no longer detected as joystick. This patch fixes that by assigning
    buttons outside the range to BTN_TRIGGER_HAPPY (as is already the case for USB
    joysticks).
    
    Furthermore this patch corrects the assignment to BTN_TRIGGER_HAPPY, as
    currently the first button over 16 is assigned to BTN_TRIGGER_HAPPY17 (i.e.
    BTN_TRIGGER_HAPPY+0x10) not BTN_TRIGGER_HAPPY.
    Signed-off-by: NIngo Ruhnke <grumbel@gmail.com>
    Acked-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
    Signed-off-by: NJiri Kosina <jkosina@suse.cz>
    f8e86d05
hid-input.c 37.2 KB