Skip to content

Commit 5478d94

Browse files
committed
Give SYN_DROPPED special treatment in evtest and fix alignment
1 parent 78650f8 commit 5478d94

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

src/evdev/eventio.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def read(self):
6666
`BlockingIOError` if there are no available events at the moment.
6767
"""
6868

69-
# events -> [(sec, usec, type, code, val), ...]
69+
# events -> ((sec, usec, type, code, val), ...)
7070
events = _input.device_read_many(self.fd)
7171

7272
for event in events:

src/evdev/evtest.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,19 @@ def print_capabilities(device):
149149
def print_event(e):
150150
if e.type == ecodes.EV_SYN:
151151
if e.code == ecodes.SYN_MT_REPORT:
152-
msg = "time {:<16} +++++++++ {} ++++++++"
152+
msg = "time {:<17} +++++++++++++ {} +++++++++++++"
153+
elif e.code == ecodes.SYN_DROPPED:
154+
msg = "time {:<17} !!!!!!!!!!!!! {} !!!!!!!!!!!!!"
153155
else:
154-
msg = "time {:<16} --------- {} --------"
156+
msg = "time {:<17} ------------- {} -------------"
155157
print(msg.format(e.timestamp(), ecodes.SYN[e.code]))
156158
else:
157159
if e.type in ecodes.bytype:
158160
codename = ecodes.bytype[e.type][e.code]
159161
else:
160162
codename = "?"
161163

162-
evfmt = "time {:<16} type {} ({}), code {:<4} ({}), value {}"
164+
evfmt = "time {:<17} type {} ({}), code {:<4} ({}), value {}"
163165
print(evfmt.format(e.timestamp(), e.type, ecodes.EV[e.type], e.code, codename, e.value))
164166

165167

0 commit comments

Comments
 (0)