Skip to content

Commit

Permalink
selftests/hid: fix failing tablet button tests
Browse files Browse the repository at this point in the history
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 <jkosina@suse.com>
Link: https://lore.kernel.org/r/20231207-b4-wip-selftests-v1-1-c4e13fe04a70@kernel.org
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
  • Loading branch information
Benjamin Tissoires committed Dec 7, 2023
1 parent f556aa9 commit da2c1b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/testing/selftests/hid/tests/test_tablet.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def from_evdev(cls, evdev) -> "PenState":
# we take only the highest button in account
for b in [libevdev.EV_KEY.BTN_STYLUS, libevdev.EV_KEY.BTN_STYLUS2]:
if bool(evdev.value[b]):
button = b
button = BtnPressed(b)

# the kernel tends to insert an EV_SYN once removing the tool, so
# the button will be released after
Expand Down Expand Up @@ -155,7 +155,7 @@ def apply(self, events: List[libevdev.InputEvent], strict: bool) -> "PenState":
if button_found:
raise ValueError(f"duplicated BTN_STYLUS* in {events}")
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 button will be released after
Expand Down

0 comments on commit da2c1b8

Please sign in to comment.