Skip to content

Commit 88a0673

Browse files
committed
improve capability formatting in evtest
1 parent deaa4e4 commit 88a0673

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎bin/evtest.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,14 @@ def print_event(e):
7676
for type, codes in capabs.items():
7777
print(' Type {} {}:'.format(*type))
7878
for i in codes:
79+
# i <- ('BTN_RIGHT', 273) or (['BTN_LEFT', 'BTN_MOUSE'], 272)
7980
if isinstance(i[1], AbsInfo):
8081
print(' Code {:<4} {}:'.format(*i[0]))
8182
print(' {}'.format(i[1]))
8283
else:
83-
print(' Code {:<4} {}'.format(*i))
84+
# multiple names may resolve to one value
85+
s = ', '.join(i[0]) if isinstance(i[0], list) else i[0]
86+
print(' Code {:<4} {}'.format(s, i[1]))
8487
print('')
8588

8689

0 commit comments

Comments
 (0)