Commit da2c1b86 authored by Benjamin Tissoires's avatar Benjamin Tissoires

selftests/hid: fix failing tablet button tests

An overlook from commit 74452d63 ("selftests/hid: tablets: add
variants of states with buttons"), where I don't use the Enum...

Fixes: 74452d63 ("selftests/hid: tablets: add variants of states with buttons")
Acked-by: default avatarJiri Kosina <jkosina@suse.com>
Link: https://lore.kernel.org/r/20231207-b4-wip-selftests-v1-1-c4e13fe04a70@kernel.orgSigned-off-by: default avatarBenjamin Tissoires <bentiss@kernel.org>
parent f556aa95
...@@ -115,7 +115,7 @@ class PenState(Enum): ...@@ -115,7 +115,7 @@ class PenState(Enum):
# we take only the highest button in account # we take only the highest button in account
for b in [libevdev.EV_KEY.BTN_STYLUS, libevdev.EV_KEY.BTN_STYLUS2]: for b in [libevdev.EV_KEY.BTN_STYLUS, libevdev.EV_KEY.BTN_STYLUS2]:
if bool(evdev.value[b]): if bool(evdev.value[b]):
button = b button = BtnPressed(b)
# the kernel tends to insert an EV_SYN once removing the tool, so # the kernel tends to insert an EV_SYN once removing the tool, so
# the button will be released after # the button will be released after
...@@ -155,7 +155,7 @@ class PenState(Enum): ...@@ -155,7 +155,7 @@ class PenState(Enum):
if button_found: if button_found:
raise ValueError(f"duplicated BTN_STYLUS* in {events}") raise ValueError(f"duplicated BTN_STYLUS* in {events}")
button_found = True button_found = True
button = ev.code if ev.value else None button = BtnPressed(ev.code) if ev.value else None
# the kernel tends to insert an EV_SYN once removing the tool, so # the kernel tends to insert an EV_SYN once removing the tool, so
# the button will be released after # the button will be released after
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment