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): def print_events(devnode, indent, evs):
devnode = os.path.basename(devnode) devnode = os.path.basename(devnode)
for e in evs: for e in evs:
print( if e.type != libevdev.EV_SYN:
"{}: {}{:06d}.{:06d} {} / {:<20s} {:4d}".format( print(
devnode, "{}: {}{:-6d}.{:06d} {} / {:<20s} {:6d}".format(
" " * (indent * 8), devnode,
e.sec, " " * (indent * 8),
e.usec, e.sec,
e.type.name, e.usec,
e.code.name, e.type.name,
e.value, e.code.name,
e.value,
)
) )
)
if e.type == libevdev.EV_SYN: if e.type == libevdev.EV_SYN:
print( print(
"{}: ------------------------------------------------".format(devnode) "{}: {}----------------- SYN_REPORT ({}) -----------------".format(
devnode, " " * (indent * 8), e.value
)
) )