aboutsummaryrefslogtreecommitdiff
path: root/src/evdev.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/evdev.c')
-rw-r--r--src/evdev.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 50847a8..d47b6c2 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -402,7 +402,7 @@ EvdevProcessValuators(InputInfoPtr pInfo, int v[MAX_VALUATORS], int *num_v,
}
if (pEvdev->rel_queued) {
- int first = REL_CNT, last = 0;
+ int first = REL_CNT, last = -1;
int i;
if (pEvdev->swap_axes) {
@@ -428,8 +428,11 @@ EvdevProcessValuators(InputInfoPtr pInfo, int v[MAX_VALUATORS], int *num_v,
}
}
- *num_v = (last - first + 1);
- *first_v = first;
+ if (last >= 0)
+ {
+ *num_v = (last - first + 1);
+ *first_v = first;
+ }
}
/*
* Some devices only generate valid abs coords when BTN_TOOL_PEN is