tools/replay: improve the verbose output a bit

Make sure our SYN_REPORT line is indented correctly for multi-device
replay and match the output a bit closer to the one from libinput
record.

Part-of: <https://gitlab.freedesktop.org/libinput/libinput/-/merge_requests/1286>
This commit is contained in:
Peter Hutterer 2025-07-16 10:04:01 +10:00
parent 936cee2242
commit 59f0d8f647

View file

@ -154,20 +154,23 @@ def create(device):
def print_events(devnode, indent, evs):
devnode = os.path.basename(devnode)
for e in evs:
print(
"{}: {}{:06d}.{:06d} {} / {:<20s} {:4d}".format(
devnode,
" " * (indent * 8),
e.sec,
e.usec,
e.type.name,
e.code.name,
e.value,
if e.type != libevdev.EV_SYN:
print(
"{}: {}{:-6d}.{:06d} {} / {:<20s} {:6d}".format(
devnode,
" " * (indent * 8),
e.sec,
e.usec,
e.type.name,
e.code.name,
e.value,
)
)
)
if e.type == libevdev.EV_SYN:
print(
"{}: ------------------------------------------------".format(devnode)
"{}: {}----------------- SYN_REPORT ({}) -----------------".format(
devnode, " " * (indent * 8), e.value
)
)