Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADB: Mouse Handler #725

Open
11 of 14 tasks
tmk opened this issue Mar 30, 2022 · 5 comments
Open
11 of 14 tasks

ADB: Mouse Handler #725

tmk opened this issue Mar 30, 2022 · 5 comments

Comments

@tmk
Copy link
Owner

tmk commented Mar 30, 2022

References

NetBSD

http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/arch/macppc/dev/ams.c?rev=1.31

Linux

https://elixir.bootlin.com/linux/v5.17/source/drivers/macintosh/adbhid.c

OpenBSD

https://github.com/openbsd/src/blob/94712de55c5b4bdbaec3eebf1d8a959bab2c2fe7/sys/dev/adb/ams.c
https://github.com/openbsd/src/blob/ac86860c81a0c162ea59c4454387b3f4c75999e1/sys/arch/macppc/dev/ams.c

Apple OSS

Classic Mouse protocol:
https://github.com/apple-oss-distributions/AppleADBMouse/blob/AppleADBMouse-212/AppleADBMouse.cpp#L146-L163
Note that 'optional second button' is ignored here.

Extended Mouse protocol:
https://github.com/apple-oss-distributions/AppleADBMouse/blob/AppleADBMouse-212/AppleADBMouse.cpp#L475-L525

ADB Pointing Devices

http://www.netbsd.org/ports/mac68k/info/netbsd-mac68k.html#adb-devices

Pointing Device Handler ID Driver Data button CPI Without Driver
Kensington Turbo Mouse 5 0x32 Ext:[4B 4D 4C 31] Kensington len=3 4 200 Yes, all four buttons are left click.
Kensington Thinking Mouse 0x32 Ext:[4B 4D 4C 31] Kensington len=3 4 400
Macally 2-button Mouse 0x42 Ext:[4B 4F 49 54] Macally2 len=4 2 200
Logitech TrackMan 0x04 Ext:[9A 21 92 F1]* Logitech len=3 3 ?
Logitech MouseMan 0x04 Ext:[9A 20 ?? ??]* Logitech len=3 3 ?
Logitech MouseMan (Extended) 0x04 Ext:[4C 54 30 31]* Extended len=3 3 400
Contour Design Countour Mouse 0x66 NetBSD/Linux len=4 3 200 Yes. [m]:click lock, [r]:change speed
Microspeed MacTrac old firmware 0x2F TMK len=2 3 LRD 100 left only and drag lock
Microspeed MacTrac new firmware 0x2F NetBSD/Linux 3 200
Mouse Systems A3 Mouse/Trackball 0x03 NetBSD/Linux 3 300*
CH Products Trackball Pro/DT225 0x42 Linux 4 ?
NeXT Mouse 0x01 Classic len=2 2 100
@tmk
Copy link
Owner Author

tmk commented Mar 30, 2022

Device handler and Data bytes

b--: Button state.(0: on, 1: off)
x--: X axis movement.
y--: Y axis movement.

Apple Classic Mouse Protocol

Data length is 2. Some mouses misuse b01(Optional second button) bit.
https://developer.apple.com/library/archive/technotes/hw/hw_01.html#Section6

Byte0: b00 y06 y05 y04 y03 y02 y01 y00
Byte1: b01 x06 x05 x04 x03 x02 x01 x00
L=b00, R=b01

Note that Right button is ignored by default #724

Apple Desktop Bus Mouse II FCC:BCGM2706

Listening:

TMK:d477af/LUFA:d6a7df

Scan:
 addr:3, reg3:6001


USB configured.

Loop start.
M:TMP: reg3:6401
M:EXT: reg3:6702
M:Classic 200cpi
M:POL: done

Scan:
 addr:10, reg3:6502

M:[ 00 80 ] mh:02
M:[ 00 80 88 88 88 ]
M:[B:01 X:0(0) Y:0(0) V:0 A:1]
M:[ 80 80 ] mh:02
M:[ 80 80 88 88 88 ]
M:[B:00 X:0(0) Y:0(0) V:0 A:1]
M:[ 00 80 ] mh:02
M:[ 00 80 88 88 88 ]
M:[B:01 X:0(0) Y:0(0) V:0 A:1]
M:[ 80 80 ] mh:02
M:[ 80 80 88 88 88 ]
M:[B:00 X:0(0) Y:0(0) V:0 A:1]
M:[ 00 80 ] mh:02
M:[ 00 80 88 88 88 ]
M:[B:01 X:0(0) Y:0(0) V:0 A:1]
M:[ 80 80 ] mh:02
M:[ 80 80 88 88 88 ]
M:[B:00 X:0(0) Y:0(0) V:0 A:1]

NeXT Mouse

This mouse sends 'optional second button' but will be ignored.
#724

Listening:

TMK:d477af/LUFA:d6a7df

Scan:


USB configured.

Loop start.
M:TMP: reg3:7601
M:EXT: reg3:7001
M:Classic 100cpi
M:POL: fail reg3:7801

Scan:
 addr:15, reg3:7B01

M:TMP: reg3:7A01
M:EXT: reg3:7E01
M:Classic 100cpi
M:POL: done

Scan:
 addr:10, reg3:7901

M:[ 81 80 ] mh:01
M:[ 81 80 88 88 88 ]
M:[B:00 X:0(0) Y:1(1) V:0 A:1]

M:[ 80 00 ] mh:01
M:[ 80 80 88 88 88 ]
M:[B:00 X:0(0) Y:0(0) V:0 A:1]

https://geekhack.org/index.php?topic=14290.msg3119857#msg3119857

Apple Extended Mouse Protocol

Data length can be 2-5 bytes
https://developer.apple.com/library/archive/technotes/hw/hw_01.html#Extended

Byte0: b00 y06 y05 y04 y03 y02 y01 y00
Byte1: b01 x06 x05 x04 x03 x02 x01 x00
Byte2: b02 y09 y08 y07 b03 x09 x08 x07
Byte3: b04 y12 y11 y10 b05 x12 x11 x10
Byte4: b06 y15 y14 y13 b07 x15 x14 x13
L=b00, R=b01, M=b02, ...

Kensington Turobo Mouse 5 / Thinking Mouse

Data length is 3. Compatible with Extended protocol.

Byte0: b00 y06 y05 y04 y03 y02 y01 y00
Byte1: b01 x06 x05 x04 x03 x02 x01 x00
Byte2: b02 y09 y08 y07 b03 x09 x08 x07
Turbo Mouse 5: Bottom_L=b00, Btottom_R=b01, Top_L=b02, Top_R=b03

XY range: -126 to 126?

[B4 FF FF] X:-1  Y:-76
[82 FF FF] X:-1  Y:-126
[82 80 F8] X:0   Y:-126
[89 FE 88] X:126 Y:9
[86 FE 88] X:126 Y:6
[89 EA 88] X:106 Y:9

Turbo Mouse 5:

Loop start.
M:TMP: reg3:6E01
M:EXT: reg3:6004
M:EXT: [4B 4D 4C 31 00 C8 02 04] cpi=200
M:TM5: found
M:TMP: reg3:6D32
TM5: setup
M:POL: done

Scan:
 addr:10, reg3:6432

Thinking Mouse:

Loop start.
M:TMP: reg3:6501
M:EXT: reg3:6504
M:EXT: [4B 4D 4C 31 01 90 01 04] cpi=400
M:TM5: found
M:TMP: reg3:6C32
TM5: setup
M:POL: done

Scan:
 addr:10, reg3:6132

MM:[ 80 80 88 ] mh:32
MM:[ 80 80 88 88 88 ]
M:[B:00 X:0(0) Y:0(0) V:0 A:2]

MM:[ 80 00 88 ] mh:32
MM:[ 80 00 88 88 88 ]
M:[B:02 X:0(0) Y:0(0) V:0 A:1]

MM:[ 80 80 08 ] mh:32
MM:[ 80 80 08 88 88 ]
M:[B:04 X:0(0) Y:0(0) V:0 A:1]

https://geekhack.org/index.php?topic=14290.msg3117929#msg3117929

Macally 2-button mouse

Data length is 4. Byte 2 and 3 are unchanged and not compatible with Extended protocol.
https://geekhack.org/index.php?topic=14290.msg3117445#msg3117445

Byte0: b00 y06 y05 y04 y03 y02 y01 y00
Byte1: b01 x06 x05 x04 x03 x02 x01 x00
Byte2: 1   0   0   0   1   0   0   0
Byte3: 1   0   0   0   1   0   0   0
L=b00, R=b01
Listening:
USB configured.

Loop start.
M:TMP: reg3:6C01
M:EXT: reg3:6104
M:EXT: [4B 4F 49 54 00 C8 01 02] cpi=200
M:Macally2: found
M:POL: done

Scan:
 addr:10, reg3:6A42

M:[ 80 81 88 88 ]
M:[ 80 81 88 88 88 ]
M:[B:00 X:1(1) Y:0(0) V:0 A:1]
M:[ 80 FF 88 88 ]
M:[ 80 FF 88 88 88 ]
M:[B:00 X:127(127) Y:0(0) V:0 A:1]

Logitech Trackman

Data length is 3. Register 1 Info : [9A 21 92 F1 3C 3B 81 38] is not compatible with Apple Extended protocol.

Byte0: b00 y06 y05 y04 y03 y02 y01 y00
Byte1: 1   x06 x05 x04 x03 x02 x01 x00
Byte2: 0   0   0   0   0   B00 B02 B01
L=B00, R=B01, M=B02
Note: Bxx becomes 1 when pressed
Note: b00 becomes 0 when either B00, B01 or B02 is pressed
TMK:99cf93/LUFA:d6a7df

Scan:


USB configured.

Loop start.
K:found: addr:2 reg3:6C02
K:setup: addr:9 reg3:6703, ISO:no
M:TMP: reg3:6A01
M:EXT: reg3:6F04
M:EXT: [9A 21 92 F1 3C 3B 81 38] cpi=15419 len=8
M:TrackMan
M:POL: done

Scan:
 addr:9, reg3:6903
 addr:10, reg3:6C04

M:[ FF 80 00 ] mh:4C
M:[ FF 80 F8 F8 F8 ]
M:[B:00 X:0(0) Y:-4(-1) V:0 A:4]
M:[ FF FF 00 ] mh:4C
M:[ FF FF FF FF FF ]
M:[B:00 X:-4(-1) Y:-4(-1) V:0 A:4]
M:[ FF 80 00 ] mh:4C
M:[ FF 80 F8 F8 F8 ]
M:[B:00 X:0(0) Y:-4(-1) V:0 A:4]
M:[ FF 81 00 ] mh:4C
M:[ FF 81 F8 F8 F8 ]
M:[B:00 X:4(1) Y:-4(-1) V:0 A:4]
M:[ 00 80 04 ] mh:4C
M:[ 00 80 88 88 88 ]
M:[B:01 X:0(0) Y:0(0) V:0 A:1]
M:[ 80 80 00 ] mh:4C
M:[ 80 80 88 88 88 ]
M:[B:00 X:0(0) Y:0(0) V:0 A:1]
M:[ 00 80 02 ] mh:4C
M:[ 80 00 88 88 88 ]
M:[B:02 X:0(0) Y:0(0) V:0 A:1]
M:[ 80 80 00 ] mh:4C
M:[ 80 80 88 88 88 ]
M:[B:00 X:0(0) Y:0(0) V:0 A:1]
M:[ 00 80 01 ] mh:4C
M:[ 80 80 08 88 88 ]
M:[B:04 X:0(0) Y:0(0) V:0 A:1]
M:[ 80 80 00 ] mh:4C
M:[ 80 80 88 88 88 ]
M:[B:00 X:0(0) Y:0(0) V:0 A:1]

Note that 0x4C is pseudo handler ID for TrackMan in TMK, real ID is still 0x04.
https://geekhack.org/index.php?topic=14290.msg3119597#msg3119597

https://geekhack.org/index.php?topic=14290.msg3119277#msg3119277
https://geekhack.org/index.php?topic=14290.msg3117403#msg3117403

Logitech MouseMan(Apple Extended)

Data length is 3.

Waiting for device:.....
Listening:

TMK:99cf93/LUFA:d6a7df

Scan:


USB configured.

Loop start.
M:TMP: reg3:6D01
M:EXT: reg3:6F04
M:EXT: [4C 54 30 31 01 90 01 03] cpi=400 len=8
M:Unknown
M:POL: done

Scan:
 addr:10, reg3:6304

M:[ 00 80 88 ] mh:04
M:[ 00 80 88 88 88 ]
M:[B:01 X:0(0) Y:0(0) V:0 A:1]
M::0(0) Y:0(0) V:0 A:1]
M:[ FF 80 F8 ] mh:04
M:[ FF 80 F8 F8 F8 ]
M:[B:00 X:0(0) Y:-1(-1) V:0 A:1]
M:[ 80 00 88 ] mh:04
M:[ 80 00 88 88 88 ]
M:[B:02 X:0(0) Y:0(0) V:0 A:1]

https://geekhack.org/index.php?topic=14290.msg3119597#msg3119597

Logitech MouseMan Cordless(Apple Extended)

Data length is 3.

Waiting for device:.....
Listening:

USB configured.

Loop start.
M:TMP: reg3:6601
M:EXT: reg3:6304
M:EXT: [4C 54 57 31 00 C8 01 03] cpi=200 len=8
M:Extended
M:POL: done

Scan:
 addr:10, reg3:6204

M:[ 87 89 88 ] mh:04
M:[ 87 89 88 88 88 ]
M:[B:00 X:9(9) Y:7(7) V:0 A:1]
M:[ 81 E8 8F ] mh:04
M:[ 81 E8 8F 8F 8F ]
M:[B:00 X:-24(-24) Y:1(1) V:0 A:1]
M:[ FF EC FF ] mh:04
M:[ FF EC FF FF FF ]
M:[B:00 X:-40(-20) Y:-2(-1) V:0 A:2]
M:[ FF F0 FF ] mh:04
M:[ FF F0 FF FF FF ]
M:[B:00 X:-16(-16) Y:-1(-1) V:0 A:1]
M:[ FF F8 FF ] mh:04
M:[ FF F8 FF FF FF ]
M:[B:00 X:-16(-8) Y:-2(-1) V:0 A:2]
M:[ FF F8 FF ] mh:04
M:[ FF F8 FF FF FF ]
M:[B:00 X:-24(-8) Y:-3(-1) V:0 A:3]

https://geekhack.org/index.php?topic=14290.msg3119857#msg3119857

Contour Mouse

Byte0: bbb y06 y05 y04 y03 y02 y01 y00
Byte1: 1   x06 x05 x04 x03 x02 x01 x00
Byte2: 0   0   0   0   1   b02 b01 b00
Byte3: 0   0   0   0   1   b02 b01 b00
Note: Bxx becomes 0 when pressed and 1 when released
Note: bbb becomes 0 when either b00, b01 or b02 is pressed
L=B00, R=B01, M=B02

This works well without driver. middle button works as 'click lock' and right button as 'speed change'.

Listening:

TMK:5db0ef/LUFA:d6a7df

Scan:


USB configured.

Loop start.
M:TMP: reg3:6966
M:POL: done

Scan:
 addr:10, reg3:6566

M:[00 80 00 00 00] len:02
MM:[ 00 80 ] mh:66
MM:[ 00 80 88 88 88 ]
M:[B:01 X:0(0) Y:0(0) V:0 A:1]
M:[80 80 00 00 00] len:02
MM:[ 80 80 ] mh:66
MM:[ 80 80 88 88 88 ]
M:[B:00 X:0(0) Y:0(0) V:0 A:1]
M:[00 80 00 00 00] len:02

https://geekhack.org/index.php?topic=14290.msg3119277#msg3119277

Now works well with driver code in TMK.

TMK:99cf93/LUFA:d6a7df

Scan:


USB configured.

Loop start.
M:TMP: reg3:6466
M:POL: done

Scan:
 addr:10, reg3:6E66

M:[ 80 FF 0F 0F ] mh:66
M:[ 80 FF 8F 8F 8F ]
M:[B:00 X:-1(-1) Y:0(0) V:0 A:1]
M:[ 00 80 0E 0E ] mh:66
M:[ 00 80 88 88 88 ]
M:[B:01 X:0(0) Y:0(0) V:0 A:1]
M:[ 80 80 0F 0F ] mh:66
M:[ 80 80 88 88 88 ]
M:[B:00 X:0(0) Y:0(0) V:0 A:1]
M:[ 80 FF 0F 0F ] mh:66
M:[ 80 FF 8F 8F 8F ]
M:[B:00 X:-1(-1) Y:0(0) V:0 A:1]
M:[ 01 80 0D 0D ] mh:66
M:[ 81 00 88 88 88 ]
M:[B:02 X:0(0) Y:2(1) V:0 A:2]
M:[ 00 80 0D 0D ] mh:66
M:[ 80 00 88 88 88 ]
M:[B:02 X:0(0) Y:0(0) V:0 A:1]
M:[ FF 80 0F 0F ] mh:66
M:[ FF 80 F8 F8 F8 ]
M:[B:00 X:0(0) Y:-2(-1) V:0 A:2]
M:[ 80 81 0F 0F ] mh:66
M:[ 80 81 88 88 88 ]
M:[B:00 X:3(1) Y:0(0) V:0 A:3]
M:[ 80 80 0F 0F ] mh:66
M:[ 80 80 88 88 88 ]
M:[B:00 X:0(0) Y:0(0) V:0 A:4]
M:[ 80 80 0F 0F ] mh:66
M:[ 80 80 88 88 88 ]
M:[B:00 X:0(0) Y:0(0) V:0 A:5]
M:[ 80 FF 0F 0F ] mh:66
M:[ 80 FF 8F 8F 8F ]
M:[B:00 X:-1(-1) Y:0(0) V:0 A:1]
M:[ 80 80 0F 0F ] mh:66
M:[ 80 80 88 88 88 ]
M:[B:00 X:0(0) Y:0(0) V:0 A:2]
M:[ 81 80 0F 0F ] mh:66
M:[ 81 80 88 88 88 ]
M:[B:00 X:0(0) Y:3(1) V:0 A:3]
M:[ 00 80 0B 0B ] mh:66
M:[ 80 80 08 88 88 ]
M:[B:04 X:0(0) Y:0(0) V:0 A:1]
M:[ 80 80 0F 0F ] mh:66
M:[ 80 80 88 88 88 ]
M:[B:00 X:0(0) Y:0(0) V:0 A:1]

https://geekhack.org/index.php?topic=14290.msg3119597#msg3119597

Microspeed MacTRAC

Not confirmed. Data length is 4?(netbsd)
https://elixir.bootlin.com/linux/v5.17/source/drivers/macintosh/adbhid.c#L464
https://github.com/NetBSD/src/blob/beecddb649a2e3a370868f6fe61348b9c18bce22/sys/arch/mac68k/dev/ams.c#L460

Byte0: ??? y06 y05 y04 y03 y02 y01 y00
Byte1: ??? x06 x05 x04 x03 x02 x01 x00
Byte2: ??? ??? ??? ??? ??? b01 b02 b00
L=b00, R=b01, M=b02?

old version?

Listening:

TMK:86482d/LUFA:d6a7df

Scan:
 addr:3, reg3:672F

Keyboard:
handler: 00, ISO: no

Scan:
 addr:3, reg3:652F

USB configured.

Loop start.

M:[00 80 00 00 00]
M:[B:01 X:0(0) Y:0(0) V:0 A:1]
M:[80 80 00 00 00]
M:[B:00 X:0(0) Y:0(0) V:0 A:1]

https://geekhack.org/index.php?topic=14290.msg3085381#msg3085381

Mouse Systems A3 Mouse/Trackball

Not confirmed. Data length is 3?(netbsd)
https://elixir.bootlin.com/linux/v5.17/source/drivers/macintosh/adbhid.c#L476
https://github.com/NetBSD/src/blob/beecddb649a2e3a370868f6fe61348b9c18bce22/sys/arch/macppc/dev/ams.c#L492

Byte0: ??? y06 y05 y04 y03 y02 y01 y00
Byte1: ??? x06 x05 x04 x03 x02 x01 x00
Byte2: ??? ??? ??? ??? ??? b01 b02 b00
L=b00, R=b01, M=b02?

CH Products Trackball Pro

Not confirmed.
https://elixir.bootlin.com/linux/v5.17/source/drivers/macintosh/adbhid.c#L470

Byte0: ??? y06 y05 y04 y03 y02 y01 y00
Byte1: ??? x06 x05 x04 x03 x02 x01 x00
Byte2: ??? ??? ??? ??? bb0 ba0 b01 b02

Button0 = (ba0 & bb0);
L=b00, R=b01, M=b02?

@tmk
Copy link
Owner Author

tmk commented Apr 9, 2022

Mouse button mapping

ADB Extended USB HID/TMK Mac OSX Windows Xorg Linux driver NetBSD driver
b00 first bit0 Button 1 Left Left button 1 Left BTN_LEFT bit0 Left
b01 second bit1 Button 2 Right Right button 3 Right BTN_MIDDLE bit1 Middle
b02 third bit2 Button 3 Middle Middle button 2 Middle BTN_RIGHT bit2 Right
b03 bit3 Button 4 ? Back button 8 Back not mapped bit3 ?
b04 bit4 Button 5 ? Forward button 9 Forward not mapped bit4 ?
b05 bit5 Button 6 ? ? button 10 ? not mapped bit5 ?
b06 bit6 Button 7 ? ? button 11 ? not mapped bit6 ?
b07 bit7 Button 8 ? ? button 12 ? not mapped bit7 ?
Apple Mouse Extended:
Byte0: b00 y06 y05 y04 y03 y02 y01 y00
Byte1: b01 x06 x05 x04 x03 x02 x01 x00
Byte2: b02 y09 y08 y07 b03 x09 x08 x07
Byte3: b04 y12 y11 y10 b05 x12 x11 x10
Byte4: b06 y15 y14 y13 b07 x15 x14 x13

ADB Mouse Button mapping in TMK(USB HID)

Kensington Turbo Mouse 5        3-button mouse

    ,--------.                       _____
    |3  __  4|                      /1|3|2\
    |  /  \  |                     |__|_|__|
    |  \__/  |                     |       |
    |1      2|                      \_____/
    `--------'

Linux/NetBSD driver

The drivers seem to map like below.
This means right button will work as middle button on 2-button and 3-button mouse.

  • ADB first button to Left
  • ADB 2nd button to Middle
  • ADB 3rd button to Right

Apple Classic Mouse

Classic Mouse driver(Handler ID: 1 and 2) supports only one button and 'optional sencond button' is ignored.

Apple Extended Mouse

OSX Apple Extended Mouse(Handler ID: 4) diriver maps second button to right and third to middle in the result.

TODO

  • Apple Classic Mouse Protocol
  • Apple Extended Mouse Protocol
  • Kensington Turobo Mouse 5
  • Kensington Thinking Mouse
  • Macally 2-button mouse
  • Logitech Trackman
  • Logitech Mouseman(Extended)
  • Microspeed MacTRAC
  • Contour Mouse
  • Mouse Systems A3 Mouse/Trackball
  • CH Products Trackball Pro

@tmk tmk changed the title ADB: Mouse driver code ADB: Mouse Handler Apr 9, 2022
@tmk
Copy link
Owner Author

tmk commented May 30, 2022

copied from wiki: https://github.com/tmk/tmk_keyboard/wiki/Apple-Desktop-Bus

ADB Deivce Specific Info

Microspeed MacTrac new firmware

TMK ADB-USB Converter supports this device.

Trackball with 3 buttons, which sends data like below after proper setup apparently.

Byte 0: b00 y06 y05 y04 y03 y02 y01 y00 
Byte 1: b01 x06 x05 x04 x03 x02 x01 x00
Byte 2:  1   1   1   1   1  b02 b01 b00
Byte 3:  1   1   1   1   1  b02 b01 b00

MacTrac 2.0 with old firmware doesn't seem to support Microspeed specific 3-button protocol above. MacTrac Deluxe and later version(after Dec 1995) of MacTrac 2.0 should support the protocol.

Kensington Turbo Mouse

TMK ADB-USB Converter supports this trackball and its 4 buttons can be used.

NetBSD driver:

Linux driver:

Configuration Bytes

/*
 * byte 0
 - 0x80 enables EMP output
 - 0x08 seems to map both buttons together
 - 0x04 enables the 2nd button
 - initialized to 0x20 on power up, no idea what that does
 
 * byte 1 assigns what which button does
 - 0x08 - button 1 - 1, button 2 - nothing
 - 0x09 - both buttons - 1
 - 0x0a - butoon 1 - 1, button 2 - toggle 1
 - 0x0b - button 1 - 1, button 2 - nothing
 - 0x0c - button 1 - 1, button 2 - 2
 - 0x0e - button 1 - 1, button 2 - 3
 - 0x0f - button 1 - 1, button 2 - toggle 3
 - 0x10 - button 1 toggle 1, button 2 nothing
 - 0x11 - button 1 - toggle 1, button 2 - 1
 - 0x12 - both toggle 1
 - 0x14 - button 1 toggle 1, button 2 - 2
 - 0x21 - button 1 - 2, button 2 - 1
 - 0x31 - button 1 - 3, button 2 - 1
 * byte 2 - 0x40 on powerup, seems to do nothing
 * byte 3 - 0x01 on powerup, seems to do nothing
 * byte 4 programs a delay for button presses, apparently in 1/100 seconds
 * byte 5 and 6 init to 0xff
 * byte 7 is a simple XOR checksum, writes will only stick if it's valid
          as in, b[7] = (b[0] ^ b[1] ^ ... ^ b[6]) ^ 0xff
 */

https://github.com/NetBSD/src/blob/8966d5b1cf335756dd9bba3331e84c659bf917e1/sys/dev/adb/adb_ktm.c#L181-L209

@tmk
Copy link
Owner Author

tmk commented Oct 22, 2023

Microspeed Trackball

My goal is adding support for Mac TRAC, which has some variants.

Manufacturing date

It seems to be indicated in M/D on its label.

Serial Trackball made during March 1999 and earlier will not work with Windows ME, Windows 2000 and Windows XP. These units may be identified by the "M/D" number at the bottom of the Trackball. The first two digits represent the year of manufacture, the second two indicate the week of the year it was made.

https://web.archive.org/web/20030823173953/http://www.microspeed.com/pages/support/supfaq.html

Mac TRAC variants

Mac TRAC Mac TRAC 2.0
FCCID FUU4TGMAP1 or FUUTB02 FUUTB02
Roller Metal Plastic

Mac TRAC 2.0 with old firmware

FCCID: FUUTB02 (1990-04)

M/D: 9302
https://www.reddit.com/media?url=https%3A%2F%2Fpreview.redd.it%2Fdoes-anyone-want-a-mactrac-2-0-trackball-v0-hxrfyvwrimpb1.jpg%3Fwidth%3D2364%26format%3Dpjpg%26auto%3Dwebp%26s%3Dd5d6ea2ae66c3a35791cc1818daf354a363f36f6

M/D: 9226
https://aucview.aucfan.com/yahoo/x1110830645/

M/D: 9427
https://www.ebay.ph/itm/265718431879?hash=item3dde0d8087:g:8BIAAOSwIgpil8dm

M/D: 9302
https://www.reddit.com/r/VintageApple/comments/16oi7w4/does_anyone_want_a_mactrac_20_trackball/

M/D: 9524
https://www.worthpoint.com/worthopedia/vintage-microspeed-mactrac-0-2742038431

Mac TRAC 2.0 with new firmware

FCCID: FUUTB02

This is compatible with new Control Panel that programs buttons.

M/D:9707-PD350
https://i.ebayimg.com/images/g/f8gAAOSwBDRlSDdP/s-l1600.jpg
https://www.ebay.com/itm/155871819386

Mac TRAC Deluxe

FCCID: FUUTB02 (1990-04)
PD-370

This is compatible with new Control Panel that programs buttons.

M/D: 9937-PD370
https://www.reddit.com/r/Trackballs/comments/ymbtaj/a_tale_of_two_trackballs/
https://www.reddit.com/media?url=https%3A%2F%2Fpreview.redd.it%2Fa-tale-of-two-trackballs-v0-r5djprf2b0y91.jpg%3Fwidth%3D4032%26format%3Dpjpg%26auto%3Dwebp%26s%3Dbd7c3789cc9343135d884a4f3cd3dd33887d9a0c

M/D: 9705-PD370
https://www.worthpoint.com/worthopedia/microspeed-mactrac-deluxe-adb-1883187592

"Includes Control Panel Software to allow you to program the three trackball buttons to perform application specific functions"
https://web.archive.org/web/20010212053110fw_/http://www.microspeed.com/trackballs/mactrac.html

Kid TRAC Mac PD-380

KidTRAC PC FCC ID: FUU4TGMAP1
KidTRAC Mac FCC ID: FUUTB02
https://web.archive.org/web/20001202234000fw_/http://www.microspeed.com/support1.html

1996-03 MicroSpeed Releases the KidTRAC(TM) Trackball
https://web.archive.org/web/19970329135727/http://www.microspeed.com/kidtrac.htm

"Both left and right button act as primary button. Center button is Drag Lock."
https://web.archive.org/web/20010217070308fw_/http://www.microspeed.com/trackballs/mackidtrac.html

Kid Trac does not support programmable buttons probably.

Micro TRAC

FCCID FUUMTRAC01

"The Macintosh version includes MicroSpeed's Control Panel Software
so you can adjust the sensitivity of the MicroTRAC to match your requirement, plus
take advantage of the extra button commands."
https://web.archive.org/web/19970329134841/http://www.microspeed.com/micromac.htm

new vs old firmware

New firmware was available after Dec 1995.
https://web.archive.org/web/19970329135742/http://www.microspeed.com/doc8.htm

On Mac TRAC 2.0 with old firmware, left click on right button and drag lock on center button.

On Mac TRAC 2.0 with new firmware and Deluxe, to make right button useful needs proprietary command sequence.

With new firmware center button works as right click by default?
https://www.reddit.com/r/Trackballs/comments/ymbtaj/a_tale_of_two_trackballs/

Control Panel

MicroSpeed Ships New Mac Control Panel Software
December 18, 1995
https://web.archive.org/web/19970329135742/http://www.microspeed.com/doc8.htm

Note: If you are using a Mac Trac 2.0 TrackBall with Control Panel software version 1.2, and you wish to download the latest software, you will need to contact the [Support Dept]. for an Upgrade Kit. You Cannot use Software version 3.4 with your current TrackBall configuration. You WILL require a firmware upgrade.
https://web.archive.org/web/20020124235248/http://www.microspeed.com/pages/support/supdown.html

MacTRAC 2.0 does not require Control Panel Software to be used as a plug in mouse replacement. For extra control and custom button functions, use the included MacTRAC Control Panel Software.
https://web.archive.org/web/19970329134824/http://www.microspeed.com/mactrac.htm

FCCID

FUU4TGQUAD1 (1989-03) https://fcc.report/FCC-ID/FUU4TGQUAD1/
For old Mac Serial or PC bus mouse.

FUUTB02 (1990-04) https://fccid.io/FUUTB02

Resources

Model list:
http://www.w2glb.com/microspeed/wintrac.html

Download:
https://web.archive.org/web/20001202234000fw_/http://www.microspeed.com/support1.html

@tmk
Copy link
Owner Author

tmk commented Oct 25, 2023

I tested with MacTRAC 2.0(old firmware) labeled as:
FCCID: FUUTB02
M/D: 9226

It does not recognize the command sequece, buttons work as two left click button and drag lock.
It sends two bytes packets and is compatible to Apple Classic.

Byte 0: b00 y06 y05 y04 y03 y02 y01 y00 
Byte 1: b01 x06 x05 x04 x03 x02 x01 x00

when there is no button and no move event(IDLE):
80 80

when Left button is depressed:
00 80

when right button is depressed:
00 00

when center button is hold:
80 00

when center button is hold and left button is depressed:
80 01

when center button is hold and right button is depressed:
81 00

when center button is hold and left and right button is depressed:
81 01

when left and right button is depressed:
80 00

right button can be discreminated from left button.

There is no movement event while center button is depressed.

On classic Mac(without tool/driver) this devices would have two left clicks on right and left button and 'drag lock' on center button.

With TMK converter it can have right click on right button now. bd6e208

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant