Lines Matching +full:button +full:-

1 .. SPDX-License-Identifier: GPL-2.0
8 descriptors are, and of how a casual (non-kernel) programmer can deal
18 hidreport-parsing
50 Documentation/hid/hid-transport.rst). Devices may misbehave because the
60 <https://www.usb.org/document-library/device-class-definition-hid-111>`_ (HID Spec from now on)
61 * the `HID Usage Tables <https://usb.org/document-library/hid-usage-tables-14>`_ (HUT from now on)
64 (USB, I2C, Bluetooth, etc.). See Documentation/hid/hid-transport.rst.
73 $ hexdump -C /sys/bus/hid/devices/0003\:093A\:2510.0002/report_descriptor
95 Documentation/hid/hidreport-parsing.rst; you only need to understand it
107 * `hid-tools <https://gitlab.freedesktop.org/libevdev/hid-tools>`_,
113 Parsing the mouse HID report descriptor with `hid-tools
114 <https://gitlab.freedesktop.org/libevdev/hid-tools>`_ leads to
117 $ ./hid-decode /sys/bus/hid/devices/0003\:093A\:2510.0002/report_descriptor
124 # 0x05, 0x09, // Usage Page (Button) 10
126 what follows is a button ::
131 first button is button number 1, last button is button number 3 ::
136 each button can send values from 0 up to including 1
141 each button is sent as exactly one bit ::
173 # 0x15, 0x81, // Logical Minimum (-127) 40
176 each of them can send values ranging from -127 up to including 127 ::
205 We can check the values sent by resorting e.g. to the `hid-recorder`
206 tool, from `hid-tools <https://gitlab.freedesktop.org/libevdev/hid-tools>`_:
207 The sequence of bytes sent by clicking and releasing button 1, then button 2, then button 3 is::
209 $ sudo ./hid-recorder /dev/hidraw1
212 output of hid-decode
215 # Button: 1 0 0 | # | X: 0 | Y: 0 | Wheel: 0
217 # Button: 0 0 0 | # | X: 0 | Y: 0 | Wheel: 0
219 # Button: 0 1 0 | # | X: 0 | Y: 0 | Wheel: 0
221 # Button: 0 0 0 | # | X: 0 | Y: 0 | Wheel: 0
223 # Button: 0 0 1 | # | X: 0 | Y: 0 | Wheel: 0
225 # Button: 0 0 0 | # | X: 0 | Y: 0 | Wheel: 0
228 This example shows that when button 2 is clicked,
230 event (``00 00 00 00``) is the release of button 2 (no buttons are
233 If instead one clicks and holds button 1, then clicks and holds button
234 2, releases button 1, and finally releases button 2, the reports are::
236 # Button: 1 0 0 | # | X: 0 | Y: 0 | Wheel: 0
238 # Button: 1 1 0 | # | X: 0 | Y: 0 | Wheel: 0
240 # Button: 0 1 0 | # | X: 0 | Y: 0 | Wheel: 0
242 # Button: 0 0 0 | # | X: 0 | Y: 0 | Wheel: 0
246 subsequent ``02 00 00 00`` button 1 is released while button 2 is still
250 ---------------------------------
320 …02, // Feature (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position,Non-volatile)
330 know what is going on, e.g. the bit for the first button translates into
339 sequence where one clicks and holds button 1, then clicks and holds
340 button 2, releases button 1, and finally releases button 2, one gets::
350 os: "opensuse-tumbleweed:20230619"
351 kernel: "6.3.7-1-default"
354 - node: /dev/input/event1
387 - ID_INPUT=1
388 - ID_INPUT_MOUSE=1
389 - LIBINPUT_DEVICE_GROUP=3/3f0/94a:usb-0000:05:00.3-2
393 - evdev:
394 - [ 0, 0, 4, 4, 30] # EV_MSC / MSC_SCAN 30 (obfuscated)
395 - [ 0, 0, 1, 272, 1] # EV_KEY / BTN_LEFT 1
396 - [ 0, 0, 0, 0, 0] # ------------ SYN_REPORT (0) ---------- +0ms
397 - evdev:
398 - [ 1, 207892, 4, 4, 30] # EV_MSC / MSC_SCAN 30 (obfuscated)
399 - [ 1, 207892, 1, 273, 1] # EV_KEY / BTN_RIGHT 1
400 - [ 1, 207892, 0, 0, 0] # ------------ SYN_REPORT (0) ---------- +1207ms
401 - evdev:
402 - [ 2, 367823, 4, 4, 30] # EV_MSC / MSC_SCAN 30 (obfuscated)
403 - [ 2, 367823, 1, 272, 0] # EV_KEY / BTN_LEFT 0
404 - [ 2, 367823, 0, 0, 0] # ------------ SYN_REPORT (0) ---------- +1160ms
406 - evdev:
407 - [ 3, 247617, 4, 4, 30] # EV_MSC / MSC_SCAN 30 (obfuscated)
408 - [ 3, 247617, 1, 273, 0] # EV_KEY / BTN_RIGHT 0
409 - [ 3, 247617, 0, 0, 0] # ------------ SYN_REPORT (0) ---------- +880ms
412 ``evemu-record``.
436 ------
439 knows how to fix - these are called the HID quirks and a list of those
444 `drivers/hid/hid-quirks.c`. How to do it should be relatively
449 .. kernel-doc:: include/linux/hid.h
454 hid-quirks.c and **be submitted upstream**.
455 See Documentation/process/submitting-patches.rst for guidelines on how
456 to submit a patch. Quirks for other busses need to go into hid-quirks.c.
459 -----------------------------
462 resort to eBPF, as described in Documentation/hid/hid-bpf.rst.
478 `drivers/hid/hid-aureal.c` or `drivers/hid/hid-samsung.c` for a slightly
481 Check Documentation/hid/hidreport-parsing.rst if you need any help
488 everyone else. See Documentation/process/submitting-patches.rst for
493 -----------------------------------------
502 ----------------------------
510 file `samples/hidraw/hid-example.c` for an example.
511 The output of ``hid-example`` would be, for the same mouse::
513 $ sudo ./hid-example
519 Raw Phys: usb-0000:05:00.4-2.3/input0