summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2010-03-15 11:08:05 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2010-03-18 08:04:01 +1000
commitd525b48a2ffeeb63fd248e21324e33156ed61ed0 (patch)
treea146867ad34afe36490f4d7772622706f5acd15d /src
parent801778c3106fc7e409369b4500253a38be6a5795 (diff)
When labeling a device as touchpad, only check for LMR buttons.
Touchpads that have physical buttons have either LMR or BTN_TOOL_FINGER. Other buttons in the range evdev recognises shouldn't be taken into account here - they skew the detection towards touchpads and away from touchscreens. Fedora Bug 571639 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
Diffstat (limited to 'src')
-rw-r--r--src/evdev.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 3051462..b532639 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1767,6 +1767,7 @@ static int
EvdevProbe(InputInfoPtr pInfo)
{
int i, has_rel_axes, has_abs_axes, has_keys, num_buttons, has_scroll;
+ int has_lmr; /* left middle right */
int kernel24 = 0;
int ignore_abs = 0, ignore_rel = 0;
EvdevPtr pEvdev = pInfo->private;
@@ -1809,6 +1810,7 @@ EvdevProbe(InputInfoPtr pInfo)
has_abs_axes = FALSE;
has_keys = FALSE;
has_scroll = FALSE;
+ has_lmr = FALSE;
num_buttons = 0;
/* count all buttons */
@@ -1823,6 +1825,10 @@ EvdevProbe(InputInfoPtr pInfo)
}
}
+ has_lmr = TestBit(BTN_LEFT, pEvdev->key_bitmask) ||
+ TestBit(BTN_MIDDLE, pEvdev->key_bitmask) ||
+ TestBit(BTN_RIGHT, pEvdev->key_bitmask);
+
if (num_buttons)
{
pEvdev->flags |= EVDEV_BUTTON_EVENTS;
@@ -1895,7 +1901,7 @@ EvdevProbe(InputInfoPtr pInfo)
}
} else if (TestBit(ABS_PRESSURE, pEvdev->abs_bitmask) ||
TestBit(BTN_TOUCH, pEvdev->key_bitmask)) {
- if (num_buttons || TestBit(BTN_TOOL_FINGER, pEvdev->key_bitmask)) {
+ if (has_lmr || TestBit(BTN_TOOL_FINGER, pEvdev->key_bitmask)) {
xf86Msg(X_INFO, "%s: Found absolute touchpad.\n", pInfo->name);
pEvdev->flags |= EVDEV_TOUCHPAD;
memset(pEvdev->old_vals, -1, sizeof(int) * pEvdev->num_vals);