Lines Matching +full:5 +full:- +full:button
1 // SPDX-License-Identifier: GPL-2.0-only
18 /* Filled in by udev-hid-bpf */
27 * tablet mode. In firmware mode (out of the box) the tablet sends button events
33 * To switch the tablet use e.g. https://github.com/whot/huion-switcher
36 * This BPF currently works for both modes only. The huion-switcher tool sets the
37 * HUION_FIRMWARE_ID udev property - if that is set then we disable the firmware
49 * # 0xa1, 0x01, // Collection (Application) 5
60 * Second hidraw node is the Pad. This one sends the button events until the tablet is
102 * # 0x85, 0x05, // Report ID (5) 75
104 * # 0x05, 0x09, // Usage Page (Button) 79
106 * # 0x29, 0x05, // UsageMaximum (5) 83
109 * # 0x95, 0x05, // Report Count (5) 89
118 * # 0x16, 0x00, 0x80, // Logical Minimum (-32768) 107
127 * # 0x15, 0x81, // Logical Minimum (-127) 127
134 * Third hidraw node is a multi-axis controller which sends the dial events
135 * and the button inside the dial. If the tablet is switched to raw mode it is mute.
140 * # 0x09, 0x0e, // Usage (System Multi-Axis Controller) 2
151 * # 0x05, 0x09, // Usage Page (Button) 24
152 * # 0x09, 0x01, // Usage (Button 1) 26
162 * # 0x16, 0x00, 0x80, // Logical Minimum (-32768) 46
233 // Byte 1 is a button so we look like a tablet
240 // Bytes 2/3 - x/y just exist so we get to be a tablet pad
249 // Bytes 4-7 are the button state for 19 buttons + pad out to u32
250 // We send the first 10 buttons as buttons 1-10 which is BTN_0 -> BTN_9
259 // We send the other 9 buttons as buttons 0x31 and above -> BTN_A - BTN_TL2
271 LogicalMinimum_i8(-1)
293 // Byte 1 is a button so we look like a tablet
300 // Bytes 2/3 - x/y just exist so we get to be a tablet pad
309 // Bytes 4-7 are the button state for 19 buttons + pad out to u32
310 // We send the first 10 buttons as buttons 1-10 which is BTN_0 -> BTN_9
319 // We send the other 9 buttons as buttons 0x31 and above -> BTN_A - BTN_TL2
331 LogicalMinimum_i8(-1)
348 __s32 rdesc_size = hctx->size; in SEC()
360 sizeof(EXPECTED_FIRMWARE_ID) - 1) == 0; in SEC()
378 * the udev property (e.g. huion-switcher run manually) in SEC()
413 if (data[5] == 2) in SEC()
416 wheel = data[5]; in SEC()
419 last_button_state = data[4] | (data[5] << 8) | (data[6] << 16); in SEC()
424 pad_report->report_id = VENDOR_REPORT_ID; in SEC()
425 pad_report->btn_stylus = 0; in SEC()
426 pad_report->x = 0; in SEC()
427 pad_report->y = 0; in SEC()
428 pad_report->buttons = last_button_state; in SEC()
429 pad_report->wheel = wheel; in SEC()
436 0x0e, /* Button 1: K */ in SEC()
437 0x0a, /* Button 2: G */ in SEC()
438 0x0f, /* Button 3: L */ in SEC()
439 0x4c, /* Button 4: Delete */ in SEC()
440 0x0c, /* Button 5: I */ in SEC()
441 0x07, /* Button 6: D */ in SEC()
442 0x05, /* Button 7: B */ in SEC()
443 0x08, /* Button 8: E */ in SEC()
444 0x16, /* Button 9: S */ in SEC()
445 0x1d, /* Button 10: Z */ in SEC()
446 0x06, /* Button 11: C */ in SEC()
447 0x19, /* Button 12: V */ in SEC()
448 0xff, /* Button 13: LeftControl */ in SEC()
449 0xff, /* Button 14: LeftAlt */ in SEC()
450 0xff, /* Button 15: LeftShift */ in SEC()
451 0x28, /* Button 16: Return Enter */ in SEC()
452 0x2c, /* Button 17: Spacebar */ in SEC()
453 0x11, /* Button 18: N */ in SEC()
493 pad_report->report_id = VENDOR_REPORT_ID; in SEC()
494 pad_report->btn_stylus = 0; in SEC()
495 pad_report->x = 0; in SEC()
496 pad_report->y = 0; in SEC()
497 pad_report->buttons = buttons; in SEC()
499 // values are unreliable (as is the button inside the wheel). in SEC()
502 pad_report->wheel = 0; in SEC()
518 switch (ctx->rdesc_size) { in probe()
522 ctx->retval = 0; in probe()
525 ctx->retval = -EINVAL; in probe()