Lines Matching +full:event +full:- +full:touch
2 # SPDX-License-Identifier: GPL-2.0
3 # -*- coding: utf-8 -*-
43 for x in range(-32000, 32000, 4000):
44 r = uhdev.event(accel=(x, None, None))
51 # to inverse calibration, followed by calibration by hid-sony.
52 assert x - 1 <= value <= x + 1
54 for y in range(-32000, 32000, 4000):
55 r = uhdev.event(accel=(None, y, None))
61 assert y - 1 <= value <= y + 1
63 for z in range(-32000, 32000, 4000):
64 r = uhdev.event(accel=(None, None, z))
70 assert z - 1 <= value <= z + 1
76 for rx in range(-2000000, 2000000, 200000):
77 r = uhdev.event(gyro=(rx, None, None))
83 # Sensor internal value is 16-bit, but calibrated is 22-bit, so
84 # 6-bit (64) difference, so allow a range of +/- 64.
85 assert rx - 64 <= value <= rx + 64
87 for ry in range(-2000000, 2000000, 200000):
88 r = uhdev.event(gyro=(None, ry, None))
94 assert ry - 64 <= value <= ry + 64
96 for rz in range(-2000000, 2000000, 200000):
97 r = uhdev.event(gyro=(None, None, rz))
103 assert rz - 64 <= value <= rz + 64
114 uhdev.event()
121 uhdev.event()
126 uhdev.event()
130 uhdev.event()
134 uhdev.event()
138 """send a single touch in the first slot of the device,
141 evdev = uhdev.get_evdev("Touch Pad")
144 r = uhdev.event(touch=[t0])
145 events = uhdev.next_sync_events("Touch Pad")
154 r = uhdev.event(touch=[t0])
155 events = uhdev.next_sync_events("Touch Pad")
158 assert evdev.slots[0][libevdev.EV_ABS.ABS_MT_TRACKING_ID] == -1
162 Make sure the kernel sees this as a dual touch.
167 evdev = uhdev.get_evdev("Touch Pad")
172 r = uhdev.event(touch=[t0])
173 events = uhdev.next_sync_events("Touch Pad")
181 assert evdev.slots[1][libevdev.EV_ABS.ABS_MT_TRACKING_ID] == -1
183 r = uhdev.event(touch=[t0, t1])
184 events = uhdev.next_sync_events("Touch Pad")
202 r = uhdev.event(touch=[t0, t1])
203 events = uhdev.next_sync_events("Touch Pad")
205 assert evdev.slots[0][libevdev.EV_ABS.ABS_MT_TRACKING_ID] == -1
211 r = uhdev.event(touch=[t1])
213 events = uhdev.next_sync_events("Touch Pad")
215 assert evdev.slots[0][libevdev.EV_ABS.ABS_MT_TRACKING_ID] == -1
216 assert evdev.slots[1][libevdev.EV_ABS.ABS_MT_TRACKING_ID] == -1
241 idx = int(k[-1]) - 1
258 # as dumped from hid-sony 'ds4_get_calibration_data'.
261 # so we can have tests passing even if hid-tools doesn't have the
264 "x": {"bias": -73, "numer": 16384, "denom": 16472},
265 "y": {"bias": -352, "numer": 16384, "denom": 16344},
302 # as dumped from hid-playstation 'dualsense_get_calibration_data'.
305 # so we can have tests passing even if hid-tools doesn't have the
309 "y": {"bias": -114, "numer": 16384, "denom": 16362},