summaryrefslogtreecommitdiff
path: root/src/evdev.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-10-26 13:09:30 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-11-11 15:50:36 +1000
commit9411749f76c31a8054ded62a6fb767c8135b4d4e (patch)
treec263455992e7ba25ace32a26fb3965a6a9aa6d5d /src/evdev.c
parent239e972be1f2c6a984dd6c5aecce710d0b866257 (diff)
Replace open_slot/close_slot with a SlotState enum
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/evdev.c')
-rw-r--r--src/evdev.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/evdev.c b/src/evdev.c
index 97da9c8..b55a0aa 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -709,9 +709,9 @@ EvdevProcessTouch(InputInfoPtr pInfo)
if (pEvdev->cur_slot < 0 || !pEvdev->mt_mask)
return;
- if (pEvdev->close_slot)
+ if (pEvdev->slot_state == SLOTSTATE_CLOSE)
type = XI_TouchEnd;
- else if (pEvdev->open_slot)
+ else if (pEvdev->slot_state == SLOTSTATE_OPEN)
type = XI_TouchBegin;
else
type = XI_TouchUpdate;
@@ -719,8 +719,7 @@ EvdevProcessTouch(InputInfoPtr pInfo)
EvdevQueueTouchEvent(pInfo, pEvdev->cur_slot, pEvdev->mt_mask, type);
- pEvdev->close_slot = 0;
- pEvdev->open_slot = 0;
+ pEvdev->slot_state = SLOTSTATE_EMPTY;
valuator_mask_zero(pEvdev->mt_mask);
}
@@ -736,9 +735,9 @@ EvdevProcessTouchEvent(InputInfoPtr pInfo, struct input_event *ev)
pEvdev->cur_slot = ev->value;
} else if (ev->code == ABS_MT_TRACKING_ID) {
if (ev->value >= 0)
- pEvdev->open_slot = 1;
+ pEvdev->slot_state = SLOTSTATE_OPEN;
else
- pEvdev->close_slot = 1;
+ pEvdev->slot_state = SLOTSTATE_CLOSE;
} else {
map = pEvdev->axis_map[ev->code] - pEvdev->num_vals;
valuator_mask_set(pEvdev->mt_mask, map, ev->value);