@@ -460,6 +460,17 @@ static uint8_t mouse_proc(uint8_t addr)
460
460
461
461
bool xneg = false;
462
462
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
463
474
if (mouse_handler == ADB_HANDLER_LOGITECH ) {
464
475
// Logitech:
465
476
// Byte0: bbb y06 y05 y04 y03 y02 y01 y00
@@ -544,14 +555,6 @@ static uint8_t mouse_proc(uint8_t addr)
544
555
} else if (mouse_handler == ADB_HANDLER_EXTENDED_MOUSE ||
545
556
mouse_handler == ADB_HANDLER_TURBO_MOUSE ) {
546
557
// 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
555
558
if (buf [len - 1 ] & 0x40 ) yneg = true;
556
559
if (buf [len - 1 ] & 0x04 ) xneg = true;
557
560
} else {
0 commit comments