summaryrefslogtreecommitdiff
path: root/src/evdev.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-12-01 15:44:39 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2009-12-03 09:27:32 +1000
commitbd4102af6e168c1b9129301f88e9601f8f5e0848 (patch)
tree98d1e056de82de30c98bfeab4d1f557d60117a73 /src/evdev.c
parent22e816eb326a5495a5dc6e0a94394534d6645bae (diff)
Fix up BTN_TOUCH handling for non-button tablets.
BTN_TOOL_* is treated as tool, just like before. BTN_TOUCH on the other hand may need to be treated as a button left press. This again requires a button class. Tested on an HP Touchsmart and a Wacom tablet. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commit 1b0df04abe329433658c95debdafdf1714173814)
Diffstat (limited to 'src/evdev.c')
-rw-r--r--src/evdev.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 9470ea8..faab8f3 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -617,7 +617,6 @@ EvdevProcessKeyEvent(InputInfoPtr pInfo, struct input_event *ev)
return;
switch (ev->code) {
- case BTN_TOUCH:
case BTN_TOOL_PEN:
case BTN_TOOL_RUBBER:
case BTN_TOOL_BRUSH:
@@ -627,7 +626,11 @@ EvdevProcessKeyEvent(InputInfoPtr pInfo, struct input_event *ev)
case BTN_TOOL_MOUSE:
case BTN_TOOL_LENS:
pEvdev->tool = value ? ev->code : 0;
- if (!(pEvdev->flags & EVDEV_TOUCHSCREEN))
+ break;
+
+ case BTN_TOUCH:
+ pEvdev->tool = value ? ev->code : 0;
+ if (!(pEvdev->flags & (EVDEV_TOUCHSCREEN | EVDEV_TABLET)))
break;
/* Treat BTN_TOUCH from devices that only have BTN_TOUCH as
* BTN_LEFT. */
@@ -1929,6 +1932,11 @@ EvdevProbe(InputInfoPtr pInfo)
{
xf86Msg(X_INFO, "%s: Found absolute tablet.\n", pInfo->name);
pEvdev->flags |= EVDEV_TABLET;
+ if (!pEvdev->num_buttons)
+ {
+ pEvdev->num_buttons = 7; /* LMR + scroll wheels */
+ pEvdev->flags |= EVDEV_BUTTON_EVENTS;
+ }
} else if (TestBit(ABS_PRESSURE, pEvdev->abs_bitmask) ||
TestBit(BTN_TOUCH, pEvdev->key_bitmask)) {
if (num_buttons || TestBit(BTN_TOOL_FINGER, pEvdev->key_bitmask)) {