summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2009-11-02 16:59:10 -0800
committerMartin Pitt <martin.pitt@ubuntu.com>2009-11-30 23:01:11 +0100
commit52e039f3b0a5749f706b97491087b9632d30512f (patch)
tree6f052933145a355b0ab2fe9fe6c2a9676cd72bf7
parent12ef5a6b8a75ffdfd718704752a3594326216ee7 (diff)
downloadhal-52e039f3b0a5749f706b97491087b9632d30512f.tar.gz
Correctly identify touchpads
BTN_TOUCH (as well as ABS_PRESSURE) is used not only by touchpads but by touchscreens as well. The proper ceck for a touchpad is presence of BTN_TOOL_FINGER and absence of BTN_TOOL_PEN (the latter to filter out some tablets that use BTN_TOOL_FINGER). Tablet matching should be on either BTN_TOOL_PEN or BTN_STYLUS. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r--hald/linux/device.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/hald/linux/device.c b/hald/linux/device.c
index 2eca1ef3..e7c9d4fa 100644
--- a/hald/linux/device.c
+++ b/hald/linux/device.c
@@ -1157,12 +1157,12 @@ input_test_abs (HalDevice *d, const char *sysfs_path)
{
num_bits_key = input_str_to_bitmask (s, bitmask_key, sizeof (bitmask_key));
- if (test_bit (BTN_STYLUS, bitmask_key)) {
+ if (test_bit (BTN_STYLUS, bitmask_key) || test_bit (BTN_TOOL_PEN, bitmask_key)) {
hal_device_add_capability (d, "input.tablet");
goto out;
}
- if (test_bit (BTN_TOUCH, bitmask_key)) {
+ if (test_bit (BTN_TOOL_FINGER, bitmask_key) && !test_bit (BTN_TOOL_PEN, bitmask_key)) {
hal_device_add_capability (d, "input.touchpad");
goto out;
}
@@ -1181,11 +1181,6 @@ input_test_abs (HalDevice *d, const char *sysfs_path)
goto out;
}
}
-
- if (test_bit (ABS_PRESSURE, bitmask_abs)) {
- hal_device_add_capability (d, "input.touchpad");
- goto out;
- }
}
out:
;