.PP
.nf
.sf
- 0.000000 +0ms: ++++++ | ************* |
- 0.021900 +21ms: →↘ +1.10/+0.14 | ************* |
- 0.033468 +11ms: →↘ +1.15/+0.19 | ************* |
- 0.043856 +10ms: →↘ +1.76/+0.22 | ************* |
- 0.053237 +9ms: →↘ +2.20/+0.19 | ************* |
+ 0.000000 +0ms TOU: ++++++ | ************* |
+ 0.021900 +21ms TOU: →↘ +1.10/+0.14 | ************* |
+ 0.033468 +11ms TOU: →↘ +1.15/+0.19 | ************* |
+ 0.043856 +10ms TOU: →↘ +1.76/+0.22 | ************* |
+ 0.053237 +9ms TOU: →↘ +2.20/+0.19 | ************* |
.fi
.in
.PP
.B ------
indicates the finger has lifted.
The left-most column is the absolute timestamp in seconds.microseconds
-followed by the relative time of the event to the previous event. The arrows
-indicate the approximate direction on a 16-point compass.
+followed by the relative time of the event to the previous event.
+.PP
+The word
+.B TOU
+in this example represents
+BTN_TOUCH, similar abbreviations exist for
+BTN_TOOL_DOUBLETAP, BTN_TOOL_TRIPLETAP, BTN_TOOL_QUADTAP, and
+BTN_TOOL_QUINTTAP.
+.PP
+The arrows
+indicate the approximate direction on a 16-point compass, in this example
+EastSouthEast.
.PP
Each multitouch slot supported by the hardware has one column, where the
column shows asterisk
slot = 0
last_time = None
+ tool_bits = {
+ libevdev.EV_KEY.BTN_TOUCH: 0,
+ libevdev.EV_KEY.BTN_TOOL_DOUBLETAP: 0,
+ libevdev.EV_KEY.BTN_TOOL_TRIPLETAP: 0,
+ libevdev.EV_KEY.BTN_TOOL_QUADTAP: 0,
+ libevdev.EV_KEY.BTN_TOOL_QUINTTAP: 0,
+ }
for event in device['events']:
for evdev in event['evdev']:
e = InputEvent(evdev)
evbit = libevdev.evbit(e.evtype, e.evcode)
+ if evbit in tool_bits:
+ tool_bits[evbit] = e.value
+
if args.use_st:
# Note: this relies on the EV_KEY events to come in before the
# x/y events, otherwise the last/first event in each slot will
s.y = e.value
s.dirty = True
- if (evbit == libevdev.EV_KEY.BTN_TOUCH or
- (evbit == libevdev.EV_KEY.BTN_TOOL_DOUBLETAP and nslots < 2) or
- (evbit == libevdev.EV_KEY.BTN_TOOL_TRIPLETAP and nslots < 3) or
- (evbit == libevdev.EV_KEY.BTN_TOOL_QUADTAP and nslots < 4) or
- (evbit == libevdev.EV_KEY.BTN_TOOL_QUINTTAP and nslots < 5)):
- print(' {} {} {} {}'.format(marker_button,
- evbit.name,
- e.value,
- marker_button))
-
if evbit == libevdev.EV_SYN.SYN_REPORT:
if last_time is None:
last_time = e.sec * 1000000 + e.usec
tdelta = int((t - last_time) / 1000) # ms
last_time = t
- print("{:2d}.{:06d} {:+4d}ms: ".format(e.sec, e.usec, tdelta), end='')
+ tools = [
+ (libevdev.EV_KEY.BTN_TOOL_QUINTTAP, 'QIN'),
+ (libevdev.EV_KEY.BTN_TOOL_QUADTAP, 'QAD'),
+ (libevdev.EV_KEY.BTN_TOOL_TRIPLETAP, 'TRI'),
+ (libevdev.EV_KEY.BTN_TOOL_DOUBLETAP, 'DBL'),
+ (libevdev.EV_KEY.BTN_TOUCH, 'TOU'),
+ ]
+
+ for bit, string in tools:
+ if tool_bits[bit]:
+ tool_state = string
+ break
+ else:
+ tool_state = ' '
+
+ print("{:2d}.{:06d} {:+5d}ms {}: ".format(e.sec, e.usec, tdelta, tool_state), end='')
for sl in [s for s in slots if s.used]:
if sl.state == SlotState.NONE:
print(marker_empty_slot, end='')