Skip to content

Commit c46d7ba

Browse files
committed
adb_usb: Fix comment
1 parent 047be5c commit c46d7ba

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

converter/adb_usb/matrix.c

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,17 @@ static uint8_t mouse_proc(uint8_t addr)
460460

461461
bool xneg = false;
462462
bool yneg = false;
463+
// Convert data into Apple Extended Mouse format
464+
//
465+
// Apple Extended Mouse:
466+
// Byte0: b00 y06 y05 y04 y03 y02 y01 y00
467+
// Byte1: b01 x06 x05 x04 x03 x02 x01 x00
468+
// Byte2: b02 y09 y08 y07 b03 x09 x08 x07
469+
// Byte3: b04 y12 y11 y10 b05 x12 x11 x10
470+
// Byte4: b06 y15 y14 y13 b07 x15 x14 x13
471+
// b--: button state(0:pressed, 1:released)
472+
// Data can be 2-5 bytes.
473+
// L=b00, R=b01, M=b02
463474
if (mouse_handler == ADB_HANDLER_LOGITECH) {
464475
// Logitech:
465476
// Byte0: bbb y06 y05 y04 y03 y02 y01 y00
@@ -544,14 +555,6 @@ static uint8_t mouse_proc(uint8_t addr)
544555
} else if (mouse_handler == ADB_HANDLER_EXTENDED_MOUSE ||
545556
mouse_handler == ADB_HANDLER_TURBO_MOUSE) {
546557
// Apple Extended Mouse:
547-
// Byte0: b00 y06 y05 y04 y03 y02 y01 y00
548-
// Byte1: b01 x06 x05 x04 x03 x02 x01 x00
549-
// Byte2: b02 y09 y08 y07 b03 x09 x08 x07
550-
// Byte3: b04 y12 y11 y10 b05 x12 x11 x10
551-
// Byte4: b06 y15 y14 y13 b07 x15 x14 x13
552-
// b--: button state(0:pressed, 1:released)
553-
// Data can be 2-5 bytes.
554-
// L=b00, R=b01, M=b02
555558
if (buf[len - 1] & 0x40) yneg = true;
556559
if (buf[len - 1] & 0x04) xneg = true;
557560
} else {

0 commit comments

Comments
 (0)