Skip to content

Commit 62aacba

Browse files
committed
Comment on why the tuple needs to be made of 6 elements
1 parent cb62973 commit 62aacba

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

evdev/uinput.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,13 @@ def __init__(self,
139139
# Flatten (ABS_Y, (0, 255, 0, 0, 0, 0)) to (ABS_Y, 0, 255, 0, 0, 0, 0).
140140
f = [code[0]]
141141
f.extend(code[1])
142+
# Ensure the tuple is always 6 ints long, since uinput.c:uinput_create
143+
# does little in the way of checking the length.
142144
f.extend([0] * (6 - len(code[1])))
143145
absinfo.append(f)
144146
code = code[0]
145147

146-
# TODO: a lot of unnecessary packing/unpacking
148+
# TODO: remove a lot of unnecessary packing/unpacking
147149
_uinput.enable(self.fd, etype, code)
148150

149151
# Create the uinput device.

0 commit comments

Comments
 (0)