summaryrefslogtreecommitdiff
path: root/tools/libinput-analyze-per-slot-delta.py
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2020-03-27 10:07:46 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2020-04-11 13:38:48 +1000
commitc23484a9ec89bd083adb971e8575fb2b49998497 (patch)
tree6c0d8ee7bea9606c3e3158253ea421171215719f /tools/libinput-analyze-per-slot-delta.py
parentdd0370f73c8d8ab65d0271c11cf1b7305fe4c41e (diff)
downloadlibinput-c23484a9ec89bd083adb971e8575fb2b49998497.tar.gz
tools: per-slot-delta: only render the slots that have been seen
Makes the output easier to understand given that most touchpads have 5+ slots but don't actually use them (or the users don't). Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'tools/libinput-analyze-per-slot-delta.py')
-rwxr-xr-xtools/libinput-analyze-per-slot-delta.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/libinput-analyze-per-slot-delta.py b/tools/libinput-analyze-per-slot-delta.py
index 3ee385ec..0df3a9be 100755
--- a/tools/libinput-analyze-per-slot-delta.py
+++ b/tools/libinput-analyze-per-slot-delta.py
@@ -54,6 +54,7 @@ class Slot:
y = 0
dx = 0
dy = 0
+ used = False
dirty = False
@@ -118,6 +119,7 @@ def main(argv):
if args.use_st:
print("Warning: slot coordinates on FINGER/DOUBLETAP change may be incorrect")
+ slots[0].used = True
slot = 0
last_time = None
@@ -165,6 +167,10 @@ def main(argv):
slot = e.value
s = slots[slot]
s.dirty = True
+ # bcm5974 cycles through slot numbers, so let's say all below
+ # our current slot number was used
+ for sl in slots[:slot + 1]:
+ sl.used = True
elif evbit == libevdev.EV_ABS.ABS_MT_TRACKING_ID:
if e.value == -1:
s.state = SlotState.END
@@ -204,7 +210,7 @@ def main(argv):
last_time = t
print("{:2d}.{:06d} {:+4d}ms: ".format(e.sec, e.usec, tdelta), end='')
- for sl in slots:
+ for sl in [s for s in slots if s.used]:
if sl.state == SlotState.NONE:
print(marker_empty_slot, end='')
elif sl.state == SlotState.BEGIN: