mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-27 03:49:57 -04:00
selftests/hid: tablets: also check for XP-Pen offset correction
The values are taken from the HID-BPF file. Basically we are recomputing the array provided there. Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-14-a8bf16033ef8@kernel.org Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
This commit is contained in:
@@ -957,10 +957,24 @@ class XPPen_ArtistPro16Gen2_28bd_095b(PenDigitizer):
|
||||
pen.eraser = False
|
||||
pen.barrelswitch = False
|
||||
|
||||
pen.xtilt = 0
|
||||
pen.ytilt = 0
|
||||
pen.current_state = state
|
||||
|
||||
def event(self, pen, test_button):
|
||||
import math
|
||||
|
||||
pen_copy = copy.copy(pen)
|
||||
width = 13.567
|
||||
height = 8.480
|
||||
tip_height = 0.055677699
|
||||
hx = tip_height * (32767 / width)
|
||||
hy = tip_height * (32767 / height)
|
||||
if pen_copy.xtilt != 0:
|
||||
pen_copy.x += round(hx * math.sin(math.radians(pen_copy.xtilt)))
|
||||
if pen_copy.ytilt != 0:
|
||||
pen_copy.y += round(hy * math.sin(math.radians(pen_copy.ytilt)))
|
||||
|
||||
return super().event(pen_copy, test_button)
|
||||
|
||||
|
||||
class XPPen_Artist24_28bd_093a(PenDigitizer):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user