Skip to content

Commit

Permalink
HID: corsair: fix mapping of non-keyboard usages
Browse files Browse the repository at this point in the history
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 <clement.vuchener@gmail.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Clément Vuchener authored and Jiri Kosina committed Feb 23, 2016
1 parent 4392bf3 commit e791f7b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/hid/hid-corsair.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,9 @@ static int corsair_input_mapping(struct hid_device *dev,
{
int gkey;

if ((usage->hid & HID_USAGE_PAGE) != HID_UP_KEYBOARD)
return 0;

gkey = corsair_usage_to_gkey(usage->hid & HID_USAGE);
if (gkey != 0) {
hid_map_usage_clear(input, usage, bit, max, EV_KEY,
Expand Down

0 comments on commit e791f7b

Please sign in to comment.