From: Hans de Goede Date: Wed, 29 Jan 2014 16:57:44 +0000 (+0100) Subject: HID: hid-microsoft: Add support for 2 reserved usage ids used on ms office kb X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=34e75dca4e6313249c9a2faa8effeddce89b91ac;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git HID: hid-microsoft: Add support for 2 reserved usage ids used on ms office kb Signed-off-by: Hans de Goede Signed-off-by: Jiri Kosina --- diff --git a/drivers/hid/hid-microsoft.c b/drivers/hid/hid-microsoft.c index fe415e8ed7c4..8ba17a946f2a 100644 --- a/drivers/hid/hid-microsoft.c +++ b/drivers/hid/hid-microsoft.c @@ -62,6 +62,22 @@ static int ms_ergonomy_kb_quirk(struct hid_input *hi, struct hid_usage *usage, { struct input_dev *input = hi->input; + if ((usage->hid & HID_USAGE_PAGE) == HID_UP_CONSUMER) { + switch (usage->hid & HID_USAGE) { + /* + * Microsoft uses these 2 reserved usage ids for 2 keys on + * the MS office kb labelled "Office Home" and "Task Pane". + */ + case 0x29d: + ms_map_key_clear(KEY_PROG1); + return 1; + case 0x29e: + ms_map_key_clear(KEY_PROG2); + return 1; + } + return 0; + } + if ((usage->hid & HID_USAGE_PAGE) != HID_UP_MSVENDOR) return 0;