提交 e791f7b1 编写于 作者: C Clément Vuchener 提交者: Jiri Kosina

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: NClément Vuchener <clement.vuchener@gmail.com>
Reviewed-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 4392bf33
...@@ -595,6 +595,9 @@ static int corsair_input_mapping(struct hid_device *dev, ...@@ -595,6 +595,9 @@ static int corsair_input_mapping(struct hid_device *dev,
{ {
int gkey; int gkey;
if ((usage->hid & HID_USAGE_PAGE) != HID_UP_KEYBOARD)
return 0;
gkey = corsair_usage_to_gkey(usage->hid & HID_USAGE); gkey = corsair_usage_to_gkey(usage->hid & HID_USAGE);
if (gkey != 0) { if (gkey != 0) {
hid_map_usage_clear(input, usage, bit, max, EV_KEY, hid_map_usage_clear(input, usage, bit, max, EV_KEY,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册