Skip to content

Commit

Permalink
Input: joydev - allow binding to button-only devices
Browse files Browse the repository at this point in the history
Dance pads don't have an axis, so allow this kind of controllers
to be used via legacy joystick interface.

Signed-off-by: Christoph Fritz <[email protected]>
Signed-off-by: Dmitry Torokhov <[email protected]>
  • Loading branch information
ch-f authored and dtor committed May 4, 2010
1 parent e938fbf commit 26a6931
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions drivers/input/joydev.c
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,24 @@ static const struct input_device_id joydev_ids[] = {
.evbit = { BIT_MASK(EV_ABS) },
.absbit = { BIT_MASK(ABS_THROTTLE) },
},
{
.flags = INPUT_DEVICE_ID_MATCH_EVBIT |
INPUT_DEVICE_ID_MATCH_KEYBIT,
.evbit = { BIT_MASK(EV_KEY) },
.keybit = {[BIT_WORD(BTN_JOYSTICK)] = BIT_MASK(BTN_JOYSTICK) },
},
{
.flags = INPUT_DEVICE_ID_MATCH_EVBIT |
INPUT_DEVICE_ID_MATCH_KEYBIT,
.evbit = { BIT_MASK(EV_KEY) },
.keybit = { [BIT_WORD(BTN_GAMEPAD)] = BIT_MASK(BTN_GAMEPAD) },
},
{
.flags = INPUT_DEVICE_ID_MATCH_EVBIT |
INPUT_DEVICE_ID_MATCH_KEYBIT,
.evbit = { BIT_MASK(EV_KEY) },
.keybit = { [BIT_WORD(BTN_TRIGGER_HAPPY)] = BIT_MASK(BTN_TRIGGER_HAPPY) },
},
{ } /* Terminating entry */
};

Expand Down

0 comments on commit 26a6931

Please sign in to comment.