Lines Matching +full:0 +full:- +full:127

2 # SPDX-License-Identifier: GPL-2.0
3 # -*- coding: utf-8 -*-
18 # workaround https://gitlab.freedesktop.org/libevdev/python-libevdev/issues/6
68 wheel, acpan = 0, 0
71 wheel = wheels[0]
107 0x05, 0x01, # .Usage Page (Generic Desktop) 0
108 0x09, 0x02, # .Usage (Mouse) 2
109 0xa1, 0x01, # .Collection (Application) 4
110 0x09, 0x02, # ..Usage (Mouse) 6
111 0xa1, 0x02, # ..Collection (Logical) 8
112 0x09, 0x01, # ...Usage (Pointer) 10
113 0xa1, 0x00, # ...Collection (Physical) 12
114 0x05, 0x09, # ....Usage Page (Button) 14
115 0x19, 0x01, # ....Usage Minimum (1) 16
116 0x29, 0x03, # ....Usage Maximum (3) 18
117 0x15, 0x00, # ....Logical Minimum (0) 20
118 0x25, 0x01, # ....Logical Maximum (1) 22
119 0x75, 0x01, # ....Report Size (1) 24
120 0x95, 0x03, # ....Report Count (3) 26
121 0x81, 0x02, # ....Input (Data,Var,Abs) 28
122 0x75, 0x05, # ....Report Size (5) 30
123 0x95, 0x01, # ....Report Count (1) 32
124 0x81, 0x03, # ....Input (Cnst,Var,Abs) 34
125 0x05, 0x01, # ....Usage Page (Generic Desktop) 36
126 0x09, 0x30, # ....Usage (X) 38
127 0x09, 0x31, # ....Usage (Y) 40
128 0x15, 0x81, # ....Logical Minimum (-127) 42
129 0x25, 0x7f, # ....Logical Maximum (127) 44
130 0x75, 0x08, # ....Report Size (8) 46
131 0x95, 0x02, # ....Report Count (2) 48
132 0x81, 0x06, # ....Input (Data,Var,Rel) 50
133 0xc0, # ...End Collection 52
134 0xc0, # ..End Collection 53
135 0xc0, # .End Collection 54
157 x = max(-127, min(127, x))
158 y = max(-127, min(127, y))
167 0x05, 0x01, # Usage Page (Generic Desktop) 0
168 0x09, 0x02, # Usage (Mouse) 2
169 0xa1, 0x01, # Collection (Application) 4
170 0x05, 0x09, # .Usage Page (Button) 6
171 0x19, 0x01, # .Usage Minimum (1) 8
172 0x29, 0x03, # .Usage Maximum (3) 10
173 0x15, 0x00, # .Logical Minimum (0) 12
174 0x25, 0x01, # .Logical Maximum (1) 14
175 0x95, 0x03, # .Report Count (3) 16
176 0x75, 0x01, # .Report Size (1) 18
177 0x81, 0x02, # .Input (Data,Var,Abs) 20
178 0x95, 0x01, # .Report Count (1) 22
179 0x75, 0x05, # .Report Size (5) 24
180 0x81, 0x03, # .Input (Cnst,Var,Abs) 26
181 0x05, 0x01, # .Usage Page (Generic Desktop) 28
182 0x09, 0x01, # .Usage (Pointer) 30
183 0xa1, 0x00, # .Collection (Physical) 32
184 0x09, 0x30, # ..Usage (X) 34
185 0x09, 0x31, # ..Usage (Y) 36
186 0x15, 0x81, # ..Logical Minimum (-127) 38
187 0x25, 0x7f, # ..Logical Maximum (127) 40
188 0x75, 0x08, # ..Report Size (8) 42
189 0x95, 0x02, # ..Report Count (2) 44
190 0x81, 0x06, # ..Input (Data,Var,Rel) 46
191 0xc0, # .End Collection 48
192 0x09, 0x38, # .Usage (Wheel) 49
193 0x15, 0x81, # .Logical Minimum (-127) 51
194 0x25, 0x7f, # .Logical Maximum (127) 53
195 0x75, 0x08, # .Report Size (8) 55
196 0x95, 0x01, # .Report Count (1) 57
197 0x81, 0x06, # .Input (Data,Var,Rel) 59
198 0xc0, # End Collection 61
210 0x05, 0x01, # Usage Page (Generic Desktop) 0
211 0x09, 0x02, # Usage (Mouse) 2
212 0xa1, 0x01, # Collection (Application) 4
213 0x09, 0x01, # .Usage (Pointer) 6
214 0xa1, 0x00, # .Collection (Physical) 8
215 0x05, 0x09, # ..Usage Page (Button) 10
216 0x19, 0x01, # ..Usage Minimum (1) 12
217 0x29, 0x10, # ..Usage Maximum (16) 14
218 0x15, 0x00, # ..Logical Minimum (0) 16
219 0x25, 0x01, # ..Logical Maximum (1) 18
220 0x95, 0x10, # ..Report Count (16) 20
221 0x75, 0x01, # ..Report Size (1) 22
222 0x81, 0x02, # ..Input (Data,Var,Abs) 24
223 0x05, 0x01, # ..Usage Page (Generic Desktop) 26
224 0x16, 0x01, 0x80, # ..Logical Minimum (-32767) 28
225 0x26, 0xff, 0x7f, # ..Logical Maximum (32767) 31
226 0x75, 0x10, # ..Report Size (16) 34
227 0x95, 0x02, # ..Report Count (2) 36
228 0x09, 0x30, # ..Usage (X) 38
229 0x09, 0x31, # ..Usage (Y) 40
230 0x81, 0x06, # ..Input (Data,Var,Rel) 42
231 0x15, 0x81, # ..Logical Minimum (-127) 44
232 0x25, 0x7f, # ..Logical Maximum (127) 46
233 0x75, 0x08, # ..Report Size (8) 48
234 0x95, 0x01, # ..Report Count (1) 50
235 0x09, 0x38, # ..Usage (Wheel) 52
236 0x81, 0x06, # ..Input (Data,Var,Rel) 54
237 0x05, 0x0c, # ..Usage Page (Consumer Devices) 56
238 0x0a, 0x38, 0x02, # ..Usage (AC Pan) 58
239 0x95, 0x01, # ..Report Count (1) 61
240 0x81, 0x06, # ..Input (Data,Var,Rel) 63
241 0xc0, # .End Collection 65
242 0xc0, # End Collection 66
254 0x05, 0x01, # Usage Page (Generic Desktop)
255 0x09, 0x02, # Usage (Mouse)
256 0xa1, 0x01, # Collection (Application)
257 0x85, 0x01, # .Report ID (1)
258 0x09, 0x01, # .Usage (Pointer)
259 0xa1, 0x00, # .Collection (Physical)
260 0x95, 0x05, # ..Report Count (5)
261 0x75, 0x01, # ..Report Size (1)
262 0x05, 0x09, # ..Usage Page (Button)
263 0x19, 0x01, # ..Usage Minimum (1)
264 0x29, 0x05, # ..Usage Maximum (5)
265 0x15, 0x00, # ..Logical Minimum (0)
266 0x25, 0x01, # ..Logical Maximum (1)
267 0x81, 0x02, # ..Input (Data,Var,Abs)
268 0x95, 0x01, # ..Report Count (1)
269 0x75, 0x03, # ..Report Size (3)
270 0x81, 0x01, # ..Input (Cnst,Arr,Abs)
271 0x75, 0x08, # ..Report Size (8)
272 0x95, 0x01, # ..Report Count (1)
273 0x05, 0x01, # ..Usage Page (Generic Desktop)
274 0x09, 0x38, # ..Usage (Wheel)
275 0x15, 0x81, # ..Logical Minimum (-127)
276 0x25, 0x7f, # ..Logical Maximum (127)
277 0x81, 0x06, # ..Input (Data,Var,Rel)
278 0x05, 0x0c, # ..Usage Page (Consumer Devices)
279 0x0a, 0x38, 0x02, # ..Usage (AC Pan)
280 0x95, 0x01, # ..Report Count (1)
281 0x81, 0x06, # ..Input (Data,Var,Rel)
282 0xc0, # .End Collection
283 0x85, 0x02, # .Report ID (2)
284 0x09, 0x01, # .Usage (Consumer Control)
285 0xa1, 0x00, # .Collection (Physical)
286 0x75, 0x0c, # ..Report Size (12)
287 0x95, 0x02, # ..Report Count (2)
288 0x05, 0x01, # ..Usage Page (Generic Desktop)
289 0x09, 0x30, # ..Usage (X)
290 0x09, 0x31, # ..Usage (Y)
291 0x16, 0x01, 0xf8, # ..Logical Minimum (-2047)
292 0x26, 0xff, 0x07, # ..Logical Maximum (2047)
293 0x81, 0x06, # ..Input (Data,Var,Rel)
294 0xc0, # .End Collection
295 0xc0, # End Collection
296 0x05, 0x0c, # Usage Page (Consumer Devices)
297 0x09, 0x01, # Usage (Consumer Control)
298 0xa1, 0x01, # Collection (Application)
299 0x85, 0x03, # .Report ID (3)
300 0x15, 0x00, # .Logical Minimum (0)
301 0x25, 0x01, # .Logical Maximum (1)
302 0x75, 0x01, # .Report Size (1)
303 0x95, 0x01, # .Report Count (1)
304 0x09, 0xcd, # .Usage (Play/Pause)
305 0x81, 0x06, # .Input (Data,Var,Rel)
306 0x0a, 0x83, 0x01, # .Usage (AL Consumer Control Config)
307 0x81, 0x06, # .Input (Data,Var,Rel)
308 0x09, 0xb5, # .Usage (Scan Next Track)
309 0x81, 0x06, # .Input (Data,Var,Rel)
310 0x09, 0xb6, # .Usage (Scan Previous Track)
311 0x81, 0x06, # .Input (Data,Var,Rel)
312 0x09, 0xea, # .Usage (Volume Down)
313 0x81, 0x06, # .Input (Data,Var,Rel)
314 0x09, 0xe9, # .Usage (Volume Up)
315 0x81, 0x06, # .Input (Data,Var,Rel)
316 0x0a, 0x25, 0x02, # .Usage (AC Forward)
317 0x81, 0x06, # .Input (Data,Var,Rel)
318 0x0a, 0x24, 0x02, # .Usage (AC Back)
319 0x81, 0x06, # .Input (Data,Var,Rel)
320 0xc0, # End Collection
323 device_input_info = (BusType.USB, 0x2717, 0x003B)
347 0x05, 0x01, # Usage Page (Generic Desktop) 83
348 0x09, 0x02, # Usage (Mouse) 85
349 0xa1, 0x01, # Collection (Application) 87
350 0x05, 0x01, # .Usage Page (Generic Desktop) 89
351 0x09, 0x02, # .Usage (Mouse) 91
352 0xa1, 0x02, # .Collection (Logical) 93
353 0x85, 0x11, # ..Report ID (17) 95
354 0x09, 0x01, # ..Usage (Pointer) 97
355 0xa1, 0x00, # ..Collection (Physical) 99
356 0x05, 0x09, # ...Usage Page (Button) 101
357 0x19, 0x01, # ...Usage Minimum (1) 103
358 0x29, 0x03, # ...Usage Maximum (3) 105
359 0x95, 0x03, # ...Report Count (3) 107
360 0x75, 0x01, # ...Report Size (1) 109
361 0x25, 0x01, # ...Logical Maximum (1) 111
362 0x81, 0x02, # ...Input (Data,Var,Abs) 113
363 0x95, 0x01, # ...Report Count (1) 115
364 0x81, 0x01, # ...Input (Cnst,Arr,Abs) 117
365 0x09, 0x05, # ...Usage (Vendor Usage 0x05) 119
366 0x81, 0x02, # ...Input (Data,Var,Abs) 121
367 0x95, 0x03, # ...Report Count (3) 123
368 0x81, 0x01, # ...Input (Cnst,Arr,Abs) 125
369 0x05, 0x01, # ...Usage Page (Generic Desktop) 127
370 0x09, 0x30, # ...Usage (X) 129
371 0x09, 0x31, # ...Usage (Y) 131
372 0x95, 0x02, # ...Report Count (2) 133
373 0x75, 0x08, # ...Report Size (8) 135
374 0x15, 0x81, # ...Logical Minimum (-127) 137
375 0x25, 0x7f, # ...Logical Maximum (127) 139
376 0x81, 0x06, # ...Input (Data,Var,Rel) 141
377 0xa1, 0x02, # ...Collection (Logical) 143
378 0x85, 0x12, # ....Report ID (18) 145
379 0x09, 0x48, # ....Usage (Resolution Multiplier) 147
380 0x95, 0x01, # ....Report Count (1) 149
381 0x75, 0x02, # ....Report Size (2) 151
382 0x15, 0x00, # ....Logical Minimum (0) 153
383 0x25, 0x01, # ....Logical Maximum (1) 155
384 0x35, 0x01, # ....Physical Minimum (1) 157
385 0x45, 0x04, # ....Physical Maximum (4) 159
386 0xb1, 0x02, # ....Feature (Data,Var,Abs) 161
387 0x35, 0x00, # ....Physical Minimum (0) 163
388 0x45, 0x00, # ....Physical Maximum (0) 165
389 0x75, 0x06, # ....Report Size (6) 167
390 0xb1, 0x01, # ....Feature (Cnst,Arr,Abs) 169
391 0x85, 0x11, # ....Report ID (17) 171
392 0x09, 0x38, # ....Usage (Wheel) 173
393 0x15, 0x81, # ....Logical Minimum (-127) 175
394 0x25, 0x7f, # ....Logical Maximum (127) 177
395 0x75, 0x08, # ....Report Size (8) 179
396 0x81, 0x06, # ....Input (Data,Var,Rel) 181
397 0xc0, # ...End Collection 183
398 0x05, 0x0c, # ...Usage Page (Consumer Devices) 184
399 0x75, 0x08, # ...Report Size (8) 186
400 0x0a, 0x38, 0x02, # ...Usage (AC Pan) 188
401 0x81, 0x06, # ...Input (Data,Var,Rel) 191
402 0xc0, # ..End Collection 193
403 0xc0, # .End Collection 194
404 0xc0, # End Collection 195
410 self.default_reportID = 0x11
412 # Feature Report 12, multiplier Feature value must be set to 0b01,
415 self.set_feature_report = [0x12, 0x1]
420 if rnum != 0x12:
430 return 0
445 0x05, 0x01, # Usage Page (Generic Desktop) 0
446 0x09, 0x02, # Usage (Mouse) 2
447 0xa1, 0x01, # Collection (Application) 4
448 0x05, 0x01, # .Usage Page (Generic Desktop) 6
449 0x09, 0x02, # .Usage (Mouse) 8
450 0xa1, 0x02, # .Collection (Logical) 10
451 0x85, 0x1a, # ..Report ID (26) 12
452 0x09, 0x01, # ..Usage (Pointer) 14
453 0xa1, 0x00, # ..Collection (Physical) 16
454 0x05, 0x09, # ...Usage Page (Button) 18
455 0x19, 0x01, # ...Usage Minimum (1) 20
456 0x29, 0x05, # ...Usage Maximum (5) 22
457 0x95, 0x05, # ...Report Count (5) 24
458 0x75, 0x01, # ...Report Size (1) 26
459 0x15, 0x00, # ...Logical Minimum (0) 28
460 0x25, 0x01, # ...Logical Maximum (1) 30
461 0x81, 0x02, # ...Input (Data,Var,Abs) 32
462 0x75, 0x03, # ...Report Size (3) 34
463 0x95, 0x01, # ...Report Count (1) 36
464 0x81, 0x01, # ...Input (Cnst,Arr,Abs) 38
465 0x05, 0x01, # ...Usage Page (Generic Desktop) 40
466 0x09, 0x30, # ...Usage (X) 42
467 0x09, 0x31, # ...Usage (Y) 44
468 0x95, 0x02, # ...Report Count (2) 46
469 0x75, 0x10, # ...Report Size (16) 48
470 0x16, 0x01, 0x80, # ...Logical Minimum (-32767) 50
471 0x26, 0xff, 0x7f, # ...Logical Maximum (32767) 53
472 0x81, 0x06, # ...Input (Data,Var,Rel) 56
473 0xa1, 0x02, # ...Collection (Logical) 58
474 0x85, 0x12, # ....Report ID (18) 60
475 0x09, 0x48, # ....Usage (Resolution Multiplier) 62
476 0x95, 0x01, # ....Report Count (1) 64
477 0x75, 0x02, # ....Report Size (2) 66
478 0x15, 0x00, # ....Logical Minimum (0) 68
479 0x25, 0x01, # ....Logical Maximum (1) 70
480 0x35, 0x01, # ....Physical Minimum (1) 72
481 0x45, 0x0c, # ....Physical Maximum (12) 74
482 0xb1, 0x02, # ....Feature (Data,Var,Abs) 76
483 0x85, 0x1a, # ....Report ID (26) 78
484 0x09, 0x38, # ....Usage (Wheel) 80
485 0x35, 0x00, # ....Physical Minimum (0) 82
486 0x45, 0x00, # ....Physical Maximum (0) 84
487 0x95, 0x01, # ....Report Count (1) 86
488 0x75, 0x10, # ....Report Size (16) 88
489 0x16, 0x01, 0x80, # ....Logical Minimum (-32767) 90
490 0x26, 0xff, 0x7f, # ....Logical Maximum (32767) 93
491 0x81, 0x06, # ....Input (Data,Var,Rel) 96
492 0xc0, # ...End Collection 98
493 0xa1, 0x02, # ...Collection (Logical) 99
494 0x85, 0x12, # ....Report ID (18) 101
495 0x09, 0x48, # ....Usage (Resolution Multiplier) 103
496 0x75, 0x02, # ....Report Size (2) 105
497 0x15, 0x00, # ....Logical Minimum (0) 107
498 0x25, 0x01, # ....Logical Maximum (1) 109
499 0x35, 0x01, # ....Physical Minimum (1) 111
500 0x45, 0x0c, # ....Physical Maximum (12) 113
501 0xb1, 0x02, # ....Feature (Data,Var,Abs) 115
502 0x35, 0x00, # ....Physical Minimum (0) 117
503 0x45, 0x00, # ....Physical Maximum (0) 119
504 0x75, 0x04, # ....Report Size (4) 121
505 0xb1, 0x01, # ....Feature (Cnst,Arr,Abs) 123
506 0x85, 0x1a, # ....Report ID (26) 125
507 0x05, 0x0c, # ....Usage Page (Consumer Devices) 127
508 0x95, 0x01, # ....Report Count (1) 129
509 0x75, 0x10, # ....Report Size (16) 131
510 0x16, 0x01, 0x80, # ....Logical Minimum (-32767) 133
511 0x26, 0xff, 0x7f, # ....Logical Maximum (32767) 136
512 0x0a, 0x38, 0x02, # ....Usage (AC Pan) 139
513 0x81, 0x06, # ....Input (Data,Var,Rel) 142
514 0xc0, # ...End Collection 144
515 0xc0, # ..End Collection 145
516 0xc0, # .End Collection 146
517 0xc0, # End Collection 147
523 self.default_reportID = 0x1A
525 # Feature Report 12, multiplier Feature value must be set to 0b0101,
528 self.set_feature_report = [0x12, 0x5]
536 return 0
547 r = uhdev.event(0, 0, (None, True, None))
554 r = uhdev.event(0, 0, (None, False, None))
555 expected_event = libevdev.InputEvent(libevdev.EV_KEY.BTN_RIGHT, 0)
559 assert evdev.value[libevdev.EV_KEY.BTN_RIGHT] == 0
561 r = uhdev.event(0, 0, (None, None, True))
568 r = uhdev.event(0, 0, (None, None, False))
569 expected_event = libevdev.InputEvent(libevdev.EV_KEY.BTN_MIDDLE, 0)
573 assert evdev.value[libevdev.EV_KEY.BTN_MIDDLE] == 0
575 r = uhdev.event(0, 0, (True, None, None))
582 r = uhdev.event(0, 0, (False, None, None))
583 expected_event = libevdev.InputEvent(libevdev.EV_KEY.BTN_LEFT, 0)
587 assert evdev.value[libevdev.EV_KEY.BTN_LEFT] == 0
589 r = uhdev.event(0, 0, (True, True, None))
600 r = uhdev.event(0, 0, (False, None, None))
601 expected_event = libevdev.InputEvent(libevdev.EV_KEY.BTN_LEFT, 0)
606 assert evdev.value[libevdev.EV_KEY.BTN_LEFT] == 0
608 r = uhdev.event(0, 0, (None, False, None))
609 expected_event = libevdev.InputEvent(libevdev.EV_KEY.BTN_RIGHT, 0)
613 assert evdev.value[libevdev.EV_KEY.BTN_RIGHT] == 0
614 assert evdev.value[libevdev.EV_KEY.BTN_LEFT] == 0
622 r = uhdev.event(0, -1)
623 expected_event = libevdev.InputEvent(libevdev.EV_REL.REL_Y, -1)
628 r = uhdev.event(1, 0)
634 r = uhdev.event(-1, 2)
635 expected_event0 = libevdev.InputEvent(libevdev.EV_REL.REL_X, -1)
654 event = (0, 0, (None, None, None))
657 event = (0, 0, (None, True, None))
660 event = (0, 0, (True, True, None))
663 event = (0, 0, (False, False, False))
666 event = (1, 0, (True, False, True))
669 event = (-1, 0, (True, False, True))
672 event = (-5, 5, (True, False, True))
675 event = (-127, 127, (True, False, True))
678 event = (0, -128, (True, False, True))
700 # need to pre-multiply too.
703 r = uhdev.event(0, 0, wheels=1 * mult)
712 r = uhdev.event(0, 0, wheels=-1 * mult)
714 expected.append(libevdev.InputEvent(libevdev.EV_REL.REL_WHEEL, -1))
716 expected.append(libevdev.InputEvent(libevdev.EV_REL.REL_WHEEL_HI_RES, -120))
721 r = uhdev.event(-1, 2, wheels=3 * mult)
723 expected.append(libevdev.InputEvent(libevdev.EV_REL.REL_X, -1))
752 # need to pre-multiply too.
756 r = uhdev.event(0, 0, wheels=(0, 1 * hmult))
765 r = uhdev.event(0, 0, wheels=(0, -1 * hmult))
767 expected.append(libevdev.InputEvent(libevdev.EV_REL.REL_HWHEEL, -1))
770 libevdev.InputEvent(libevdev.EV_REL.REL_HWHEEL_HI_RES, -120)
776 r = uhdev.event(-1, 2, wheels=(0, 3 * hmult))
778 expected.append(libevdev.InputEvent(libevdev.EV_REL.REL_X, -1))
787 r = uhdev.event(-1, 2, wheels=(-3 * vmult, 4 * hmult))
789 expected.append(libevdev.InputEvent(libevdev.EV_REL.REL_X, -1))
791 expected.append(libevdev.InputEvent(libevdev.EV_REL.REL_WHEEL, -3))
793 expected.append(libevdev.InputEvent(libevdev.EV_REL.REL_WHEEL_HI_RES, -360))
823 assert 120 % uhdev.wheel_multiplier == 0
836 r = uhdev.event(0, 0, wheels=1)
845 r = uhdev.event(0, 0, wheels=-1)
848 libevdev.InputEvent(libevdev.EV_REL.REL_WHEEL_HI_RES, -120 / mult)
856 expected.append(libevdev.InputEvent(libevdev.EV_REL.REL_Y, -2))
861 for _ in range(mult - 1):
862 r = uhdev.event(1, -2, wheels=1)
867 r = uhdev.event(1, -2, wheels=1)
912 assert 120 % uhdev.hwheel_multiplier == 0
925 r = uhdev.event(0, 0, wheels=(0, 1))
934 r = uhdev.event(0, 0, wheels=(0, -1))
937 libevdev.InputEvent(libevdev.EV_REL.REL_HWHEEL_HI_RES, -120 / hmult)
945 expected.append(libevdev.InputEvent(libevdev.EV_REL.REL_Y, -2))
950 for _ in range(hmult - 1):
951 r = uhdev.event(1, -2, wheels=(0, 1))
956 r = uhdev.event(1, -2, wheels=(0, 1))
972 remaining.remove(libevdev.InputEvent(libevdev.EV_SYN.SYN_REPORT, 0))