Skip to content

Commit da2c1b8

Browse files
author
Benjamin Tissoires
committed
selftests/hid: fix failing tablet button tests
An overlook from commit 74452d6 ("selftests/hid: tablets: add variants of states with buttons"), where I don't use the Enum... Fixes: 74452d6 ("selftests/hid: tablets: add variants of states with buttons") Acked-by: Jiri Kosina <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Benjamin Tissoires <[email protected]>
1 parent f556aa9 commit da2c1b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/testing/selftests/hid/tests/test_tablet.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def from_evdev(cls, evdev) -> "PenState":
115115
# we take only the highest button in account
116116
for b in [libevdev.EV_KEY.BTN_STYLUS, libevdev.EV_KEY.BTN_STYLUS2]:
117117
if bool(evdev.value[b]):
118-
button = b
118+
button = BtnPressed(b)
119119

120120
# the kernel tends to insert an EV_SYN once removing the tool, so
121121
# the button will be released after
@@ -155,7 +155,7 @@ def apply(self, events: List[libevdev.InputEvent], strict: bool) -> "PenState":
155155
if button_found:
156156
raise ValueError(f"duplicated BTN_STYLUS* in {events}")
157157
button_found = True
158-
button = ev.code if ev.value else None
158+
button = BtnPressed(ev.code) if ev.value else None
159159

160160
# the kernel tends to insert an EV_SYN once removing the tool, so
161161
# the button will be released after

0 commit comments

Comments
 (0)