[PATCH 2/2] selftests/hid-tablet: add ABS_DISTANCE test to stylus/pen

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



ABS_DISTANCE was not supported for stylus and pen. This test is to
make sure the ABS_DISTANCE event is supported, if reported.

Signed-off-by: Ping Cheng <ping.cheng@xxxxxxxxx>
---
 tools/testing/selftests/hid/tests/test_tablet.py | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tools/testing/selftests/hid/tests/test_tablet.py b/tools/testing/selftests/hid/tests/test_tablet.py
index a9e2de1e8861..40f6c3495394 100644
--- a/tools/testing/selftests/hid/tests/test_tablet.py
+++ b/tools/testing/selftests/hid/tests/test_tablet.py
@@ -451,6 +451,7 @@ class Pen(object):
     def __init__(self, x, y):
         self.x = x
         self.y = y
+        self.distance = 0
         self.tipswitch = False
         self.tippressure = 15
         self.azimuth = 0
@@ -472,6 +473,7 @@ class Pen(object):
             for i in [
                 "x",
                 "y",
+                "distance"
                 "tippressure",
                 "azimuth",
                 "width",
@@ -550,6 +552,7 @@ class PenDigitizer(base.UHIDTestDevice):
             pen.backup()
             pen.x = 0
             pen.y = 0
+            pen.distance = 0
             pen.tipswitch = False
             pen.tippressure = 0
             pen.azimuth = 0
@@ -929,6 +932,7 @@ class XPPen_ArtistPro16Gen2_28bd_095b(PenDigitizer):
             pen.backup()
             pen.x = 0
             pen.y = 0
+            pen.distance = 0
             pen.tipswitch = False
             pen.tippressure = 0
             pen.azimuth = 0
-- 
2.50.0





[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux