Lines Matching +full:5 +full:- +full:button
1 // SPDX-License-Identifier: GPL-2.0-only
19 /* Filled in by udev-hid-bpf */
28 * tablet mode. In firmware mode (out of the box) the tablet sends button events
34 * To switch the tablet use e.g. https://github.com/whot/huion-switcher
37 * This BPF works for both modes. The huion-switcher tool sets the
38 * HUION_FIRMWARE_ID udev property - if that is set then we disable the firmware
49 * # 0xa1, 0x01, // Collection (Application) 5
59 * https://github.com/whot/huion-switcher
90 * # 0x55, 0x0d, // Unit Exponent (-3) 46
106 * # 0x15, 0x81, // Logical Minimum (-127) 81
121 * # 0x09, 0x0e, // Usage (System Multi-Axis Controller) 2
132 * # 0x05, 0x09, // Usage Page (Button) 24
143 * # 0x16, 0x00, 0x80, // Logical Minimum (-32768) 46
215 // -- Byte 0 in report
222 // Byte 1 in report - just exists so we get to be a tablet pad
229 // Bytes 2/3 in report - just exists so we get to be a tablet pad
238 LogicalMinimum_i8(-1)
243 // Byte 5 is the button state
264 // -- Byte 0 in report
268 // -- Byte 1 in report
287 UnitExponent(-1)
299 Input(Var|Abs) // Bytes 4+5
308 LogicalMinimum_i8(-60)
345 UnitExponent(-1)
359 // Bytes 4/5 in report
371 LogicalMinimum_i8(-60)
399 // Bytes 2/3 - x/y just exist so we get to be a tablet pad
406 // Byte 4 is the button state
415 // Byte 5 is the top dial
418 LogicalMinimum_i8(-1)
445 __s32 rdesc_size = hctx->size; in SEC()
457 sizeof(EXPECTED_FIRMWARE_ID) - 1) == 0; in SEC()
477 * the udev property (e.g. huion-switcher run manually) in SEC()
491 static __u8 button; in SEC() local
498 /* Nicely enough, this device only supports one button down at a time so in SEC()
500 * Button released: 03 00 00 00 00 00 00 00 in SEC()
501 * Button 1: 03 00 05 00 00 00 00 00 -> b in SEC()
502 * Button 2: 03 00 08 00 00 00 00 00 -> e in SEC()
503 * Button 3: 03 00 0c 00 00 00 00 00 -> i in SEC()
504 * Button 4: 03 00 e0 16 00 00 00 00 -> Ctrl S in SEC()
505 * Button 5: 03 00 2c 00 00 00 00 00 -> space in SEC()
506 * Button 6: 03 00 e0 e2 1d 00 00 00 -> Ctrl Alt Z in SEC()
508 button &= 0xc0; in SEC()
514 button |= BIT(0); in SEC()
517 button |= BIT(1); in SEC()
520 button |= BIT(2); in SEC()
523 button |= BIT(3); in SEC()
526 button |= BIT(4); in SEC()
529 button |= BIT(5); in SEC()
533 __u8 report[8] = {PAD_REPORT_ID, 0x0, 0x0, 0x0, 0x00, button}; in SEC()
544 * Dial down: 11 00 ff ff 00 00 00 00 00 -> Dial -1 in SEC()
545 * Dial up: 11 00 01 00 00 00 00 00 00 -> Dial 1 in SEC()
549 button &= 0x3f; in SEC()
550 button |= !!data[1] << 6; in SEC()
552 __u8 report[] = {PAD_REPORT_ID, 0x0, 0x0, 0x0, dial, button}; in SEC()
580 if (data[5] == 2) in SEC()
583 d = data[5]; in SEC()
598 pad_report->report_id = PAD_REPORT_ID; in SEC()
599 pad_report->btn_stylus = 0; in SEC()
600 pad_report->x = 0; in SEC()
601 pad_report->y = 0; in SEC()
602 pad_report->buttons = last_button_state; in SEC()
603 pad_report->dial_1 = dial_1; in SEC()
604 pad_report->dial_2 = dial_2; in SEC()
623 switch (ctx->rdesc_size) { in probe()
627 ctx->retval = 0; in probe()
630 ctx->retval = -EINVAL; in probe()