Skip to content

Commit e08e493

Browse files
author
Benjamin Tissoires
committed
selftests/hid: tablets: set initial data for tilt/twist
Avoids getting a null event when these usages are set Reviewed-by: Peter Hutterer <[email protected]> Acked-by: Jiri Kosina <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Benjamin Tissoires <[email protected]>
1 parent d8d7aa2 commit e08e493

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,9 @@ def __init__(self, x, y):
276276
self.barrelswitch = False
277277
self.invert = False
278278
self.eraser = False
279-
self.x_tilt = 0
280-
self.y_tilt = 0
281-
self.twist = 0
279+
self.xtilt = 1
280+
self.ytilt = 1
281+
self.twist = 1
282282
self._old_values = None
283283
self.current_state = None
284284

@@ -292,8 +292,8 @@ def restore(self):
292292
"width",
293293
"height",
294294
"twist",
295-
"x_tilt",
296-
"y_tilt",
295+
"xtilt",
296+
"ytilt",
297297
]:
298298
setattr(self, i, getattr(self._old_values, i))
299299

@@ -361,8 +361,8 @@ def move_to(self, pen, state):
361361
pen.height = 0
362362
pen.invert = False
363363
pen.eraser = False
364-
pen.x_tilt = 0
365-
pen.y_tilt = 0
364+
pen.xtilt = 0
365+
pen.ytilt = 0
366366
pen.twist = 0
367367
elif state == PenState.PEN_IS_IN_RANGE:
368368
pen.tipswitch = False

0 commit comments

Comments
 (0)