hal: Branch 'master'
Martin Pitt
martin at kemper.freedesktop.org
Mon Nov 30 14:01:08 PST 2009
hald/linux/device.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
New commits:
commit 52e039f3b0a5749f706b97491087b9632d30512f
Author: Dmitry Torokhov <dmitry.torokhov at gmail.com>
Date: Mon Nov 2 16:59:10 2009 -0800
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 at mail.ru>
diff --git a/hald/linux/device.c b/hald/linux/device.c
index 2eca1ef..e7c9d4f 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:
;
More information about the hal-commit
mailing list