Skip to content

Commit e791f7b

Browse files
cvuchenerJiri Kosina
authored andcommitted
HID: corsair: fix mapping of non-keyboard usages
This fixes a bug where the Volume Up key was ignored because it uses the same usage code as G18. Special Corsair usage codes are in the keyboard page, other pages should be left to the generic driver. Signed-off-by: Clément Vuchener <[email protected]> Reviewed-by: Benjamin Tissoires <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 4392bf3 commit e791f7b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/hid/hid-corsair.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,9 @@ static int corsair_input_mapping(struct hid_device *dev,
595595
{
596596
int gkey;
597597

598+
if ((usage->hid & HID_USAGE_PAGE) != HID_UP_KEYBOARD)
599+
return 0;
600+
598601
gkey = corsair_usage_to_gkey(usage->hid & HID_USAGE);
599602
if (gkey != 0) {
600603
hid_map_usage_clear(input, usage, bit, max, EV_KEY,

0 commit comments

Comments
 (0)