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 works for both modes. 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
59 * https://github.com/whot/huion-switcher
75 * # 0x09, 0x3c, // Usage (Invert) 18 <-- has no Invert eraser
89 * # 0x55, 0x0d, // Unit Exponent (-3) 46 <-- change to -2
90 * # 0x65, 0x33, // Unit (EnglishLinear: in³) 48 <-- change in³ to in
93 * # 0x46, 0x00, 0x08, // Physical Maximum (2048) 55 <-- invalid size
103 * # 0x09, 0x3d, // Usage (X Tilt) 77 <-- No tilt reported
105 * # 0x15, 0x81, // Logical Minimum (-127) 81
171 // -- Byte 0 in report
178 // Byte 1 in report - just exists so we get to be a tablet pad
185 // Bytes 2/3 in report - just exists so we get to be a tablet pad
194 LogicalMinimum_i8(-1)
199 // Byte 5 is the button state
218 // -- Byte 0 in report
222 // -- Byte 1 in report
241 UnitExponent(-1)
253 Input(Var|Abs) // Bytes 4+5
296 UnitExponent(-1)
310 // Bytes 4/5 in report
338 // Bytes 2/3 - x/y just exist so we get to be a tablet pad
345 // Byte 4 is the button state
356 // Byte 5 is the wheel
359 LogicalMinimum_i8(-1)
382 __s32 rdesc_size = hctx->size; in SEC()
394 sizeof(EXPECTED_FIRMWARE_ID) - 1) == 0; in SEC()
414 * the udev property (e.g. huion-switcher run manually) in SEC()
434 /* Nicely enough, this device only supports one button down at a time so in SEC()
436 * Button released: 03 00 00 00 00 00 00 00 in SEC()
437 * Button 1: 03 00 05 00 00 00 00 00 -> b in SEC()
438 * Button 2: 03 00 0c 00 00 00 00 00 -> i in SEC()
439 * Button 3: 03 00 08 00 00 00 00 00 -> e in SEC()
440 * Button 4: 03 01 16 00 00 00 00 00 -> Ctrl S in SEC()
441 * Button 5: 03 00 2c 00 00 00 00 00 -> space in SEC()
442 * Button 6: 03 05 1d 00 00 00 00 00 -> Ctrl Alt Z in SEC()
444 * Wheel down: 03 01 2d 00 00 00 00 00 -> Ctrl - in SEC()
445 * Wheel up: 03 01 2e 00 00 00 00 00 -> Ctrl = in SEC()
447 __u8 button = 0; in SEC() local
454 button = 1; in SEC()
457 button = 2; in SEC()
460 button = 3; in SEC()
463 button = 4; in SEC()
466 button = 5; in SEC()
469 button = 6; in SEC()
472 wheel = -1; in SEC()
480 __u8 report[6] = {PAD_REPORT_ID, 0x0, 0x0, 0x0, wheel, button}; in SEC()
505 if (data[5] == 2) in SEC()
508 wheel = data[5]; in SEC()
517 pad_report->report_id = PAD_REPORT_ID; in SEC()
518 pad_report->btn_stylus = 0; in SEC()
519 pad_report->x = 0; in SEC()
520 pad_report->y = 0; in SEC()
521 pad_report->buttons = last_button_state; in SEC()
522 pad_report->wheel = wheel; in SEC()
541 switch (ctx->rdesc_size) { in probe()
545 ctx->retval = 0; in probe()
548 ctx->retval = -EINVAL; in probe()