From 421596e7ee71c98f52bb43522a5c5c28a5374729 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 17 Dec 2008 13:34:19 +1000 Subject: [PATCH] Fix input.tablet handling - we want ABS_X, ABS_Y and BTN_TOUCH. The previous check was hiding behind (ABS_X && !ABS_Y) which (as the comment suggests) is iffy at best. Move the check for the BTN_TOUCH bitmask up to the rest of the input.mouse checking and assign input.tablet accordingly. --- hald/linux/device.c | 29 +++++++++++++++-------------- 1 files changed, 15 insertions(+), 14 deletions(-) diff --git a/hald/linux/device.c b/hald/linux/device.c index d16ac3a..ef26a8e 100644 --- a/hald/linux/device.c +++ b/hald/linux/device.c @@ -1078,11 +1078,21 @@ input_test_abs (HalDevice *d, const char *sysfs_path) hal_device_add_capability (d, "input.touchpad"); goto out; } else { - /* - * This path is taken by VMware's USB mouse, which has - * absolute axes, but no touch/pressure button. - */ - hal_device_add_capability (d, "input.mouse"); + long bitmask_touch[NBITS(KEY_MAX)]; + s = hal_util_get_string_from_file (sysfs_path, "capabilities/key"); + if (s == NULL) + goto out; + input_str_to_bitmask (s, bitmask_touch, sizeof (bitmask_touch)); + + if (test_bit(BTN_TOUCH, bitmask_touch)) { + hal_device_add_capability (d, "input.tablet"); + } else { + /* + * This path is taken by VMware's USB mouse, which has + * absolute axes, but no touch/pressure button. + */ + hal_device_add_capability (d, "input.mouse"); + } goto out; } } @@ -1092,15 +1102,6 @@ input_test_abs (HalDevice *d, const char *sysfs_path) long bitmask_touch[NBITS(KEY_MAX)]; hal_device_add_capability (d, "input.joystick"); - - s = hal_util_get_string_from_file (sysfs_path, "capabilities/key"); - if (s == NULL) - goto out; - input_str_to_bitmask (s, bitmask_touch, sizeof (bitmask_touch)); - - if (test_bit(BTN_TOUCH, bitmask_touch)) { - hal_device_add_capability (d, "input.tablet"); - } } out: ; -- 1.6.0.4