lkml.org 
[lkml]   [2021]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] HID: multitouch: only map BTN_LEFT on buttonpads
Date
In addition to map the INPUT_PROP_BUTTONPAD property, make sure that
the BTN_RIGHT and BTN_MIDDLE key bits are not mapped.

Mapping more than one button on buttonpads is a bug plus avoids issues
with some touchpads on user space. For more information, check these
bug reports:

- https://gitlab.freedesktop.org/libinput/libinput/-/issues/674
- https://gitlab.freedesktop.org/libinput/libinput/-/issues/689
- https://gitlab.freedesktop.org/libinput/libinput/-/issues/629

Signed-off-by: José Expósito <jose.exposito89@gmail.com>
---
drivers/hid/hid-multitouch.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index e1afddb7b33d..37697ebe27f9 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -1286,8 +1286,11 @@ static int mt_touch_input_configured(struct hid_device *hdev,
(app->buttons_count == 1))
td->is_buttonpad = true;

- if (td->is_buttonpad)
+ if (td->is_buttonpad) {
__set_bit(INPUT_PROP_BUTTONPAD, input->propbit);
+ __clear_bit(BTN_RIGHT, dev->keybit);
+ __clear_bit(BTN_MIDDLE, dev->keybit);
+ }

app->pending_palm_slots = devm_kcalloc(&hi->input->dev,
BITS_TO_LONGS(td->maxcontacts),
--
2.25.1
\
 
 \ /
  Last update: 2021-11-23 20:13    [W:1.369 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site