Skip to content

Commit

Permalink
selftests/hid: tablets: set initial data for tilt/twist
Browse files Browse the repository at this point in the history
Avoids getting a null event when these usages are set

Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Jiri Kosina <jkosina@suse.com>
Link: https://lore.kernel.org/r/20231206-wip-selftests-v2-8-c0350c2f5986@kernel.org
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
  • Loading branch information
Benjamin Tissoires committed Dec 7, 2023
1 parent d8d7aa2 commit e08e493
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tools/testing/selftests/hid/tests/test_tablet.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,9 @@ def __init__(self, x, y):
self.barrelswitch = False
self.invert = False
self.eraser = False
self.x_tilt = 0
self.y_tilt = 0
self.twist = 0
self.xtilt = 1
self.ytilt = 1
self.twist = 1
self._old_values = None
self.current_state = None

Expand All @@ -292,8 +292,8 @@ def restore(self):
"width",
"height",
"twist",
"x_tilt",
"y_tilt",
"xtilt",
"ytilt",
]:
setattr(self, i, getattr(self._old_values, i))

Expand Down Expand Up @@ -361,8 +361,8 @@ def move_to(self, pen, state):
pen.height = 0
pen.invert = False
pen.eraser = False
pen.x_tilt = 0
pen.y_tilt = 0
pen.xtilt = 0
pen.ytilt = 0
pen.twist = 0
elif state == PenState.PEN_IS_IN_RANGE:
pen.tipswitch = False
Expand Down

0 comments on commit e08e493

Please sign in to comment.