diff options
Diffstat (limited to 'src/evdev.c')
-rw-r--r-- | src/evdev.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/evdev.c b/src/evdev.c index 851ae8d..ae20de3 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -392,7 +392,7 @@ EvdevProcessValuators(InputInfoPtr pInfo, int v[MAX_VALUATORS], int *num_v, for (i = 0; i < REL_CNT; i++) { int map = pEvdev->axis_map[i]; - if (map != -1) + if (pEvdev->delta[i] && map != -1) { v[map] = pEvdev->delta[i]; if (map < first) @@ -406,11 +406,11 @@ EvdevProcessValuators(InputInfoPtr pInfo, int v[MAX_VALUATORS], int *num_v, *first_v = first; } /* - * Some devices only generate valid abs coords when BTN_DIGI is + * Some devices only generate valid abs coords when BTN_TOOL_PEN is * pressed. On wacom tablets, this means that the pen is in - * proximity of the tablet. After the pen is removed, BTN_DIGI is + * proximity of the tablet. After the pen is removed, BTN_TOOL_PEN is * released, and a (0, 0) absolute event is generated. Checking - * pEvdev->digi here, lets us ignore that event. pEvdev is + * pEvdev->tool here, lets us ignore that event. pEvdev is * initialized to 1 so devices that doesn't use this scheme still * just works. */ @@ -583,7 +583,6 @@ EvdevProcessKeyEvent(InputInfoPtr pInfo, struct input_event *ev) 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 @@ -621,9 +620,9 @@ EvdevPostAbsoluteMotionEvents(InputInfoPtr pInfo, int *num_v, int *first_v, EvdevPtr pEvdev = pInfo->private; /* - * Some devices only generate valid abs coords when BTN_DIGI is + * Some devices only generate valid abs coords when BTN_TOOL_PEN is * pressed. On wacom tablets, this means that the pen is in - * proximity of the tablet. After the pen is removed, BTN_DIGI is + * proximity of the tablet. After the pen is removed, BTN_TOOL_PEN is * released, and a (0, 0) absolute event is generated. Checking * pEvdev->tool here, lets us ignore that event. pEvdev->tool is * initialized to 1 so devices that don't use this scheme still @@ -668,7 +667,7 @@ static void EvdevProcessSyncEvent(InputInfoPtr pInfo, struct input_event *ev) { int num_v = 0, first_v = 0; - int v[MAX_VALUATORS]; + int v[MAX_VALUATORS] = {}; EvdevPtr pEvdev = pInfo->private; EvdevProcessValuators(pInfo, v, &num_v, &first_v); @@ -1875,7 +1874,9 @@ EvdevProbe(InputInfoPtr pInfo) if ((TestBit(ABS_X, pEvdev->abs_bitmask) && TestBit(ABS_Y, pEvdev->abs_bitmask))) { xf86Msg(X_PROBED, "%s: Found x and y absolute axes\n", pInfo->name); - if (TestBit(BTN_TOOL_PEN, pEvdev->key_bitmask)) + if (TestBit(BTN_TOOL_PEN, pEvdev->key_bitmask) || + TestBit(BTN_STYLUS, pEvdev->key_bitmask) || + TestBit(BTN_STYLUS2, pEvdev->key_bitmask)) { xf86Msg(X_PROBED, "%s: Found absolute tablet.\n", pInfo->name); pEvdev->flags |= EVDEV_TABLET; |