summaryrefslogtreecommitdiff
path: root/src/evdev.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2009-01-19 21:23:34 +1100
committerPeter Hutterer <peter.hutterer@who-t.net>2009-01-19 21:23:34 +1100
commita7e8af65fca9c38a8c0c24ffc660c06c8d4a0b9b (patch)
tree9e69e0a97915f1f9d06d29c499dbf6e7280d3d20 /src/evdev.c
parent0592d97fbb5a1241ee79397ce9203346d050a9f9 (diff)
Test for pressure BEFORE using has_pressure.
Diffstat (limited to 'src/evdev.c')
-rw-r--r--src/evdev.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/evdev.c b/src/evdev.c
index b1e5c9a..576fe62 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -1392,6 +1392,17 @@ EvdevProbe(InputInfoPtr pInfo)
has_scroll = TRUE;
}
+ if (TestBit(ABS_PRESSURE, abs_bitmask)) {
+ struct input_absinfo absinfo_p;
+
+ /* More than two pressure levels indicate it's not a button */
+ if (ioctl(pInfo->fd,
+ EVIOCGABS(ABS_PRESSURE), &absinfo_p) == 0) {
+ if ((absinfo_p.maximum - absinfo_p.minimum) > 1)
+ pEvdev->has_pressure = TRUE;
+ }
+ }
+
if (TestBit(ABS_X, abs_bitmask) && TestBit(ABS_Y, abs_bitmask)) {
xf86Msg(X_INFO, "%s: Found x and y absolute axes\n", pInfo->name);
pEvdev->flags |= EVDEV_ABSOLUTE_EVENTS;
@@ -1409,17 +1420,6 @@ EvdevProbe(InputInfoPtr pInfo)
has_axes = TRUE;
}
- if (TestBit(ABS_PRESSURE, abs_bitmask)) {
- struct input_absinfo absinfo_p;
-
- /* More than two pressure levels indicate it's not a button */
- if (ioctl(pInfo->fd,
- EVIOCGABS(ABS_PRESSURE), &absinfo_p) == 0) {
- if ((absinfo_p.maximum - absinfo_p.minimum) > 1)
- pEvdev->has_pressure = TRUE;
- }
- }
-
for (i = 0; i < BTN_MISC; i++)
if (TestBit(i, key_bitmask))
break;