Atari VCS Wireless Joystick as mouse
- 2 minutes read - 317 wordsI bought a friend an Atari VCS Wireless Joystick as a Christmas gift thinking (incorrectly) it would work with an Atari 2600+. My only defense is that, I didn’t realize the VCS is different, the joystick looks the same and, I’m stupid for not reading the fine print. I subsequently bought my friend the correct, CX40+.
I am intrigued to see whether I can now repurpose the joystick as an alterntive mouse for a Linux machine. So far, this idea shows promise…
Gemini suggested combining 2 Rust libraries:
The joystick supports USB and bluetooth.
With the USB cable, lsusb reported:
Bus 001 Device 010: ID 045e:028e Microsoft Corp. Xbox360 Controller
After connecting a host machine to the joystick over bluetooth and identifying the device using:
bluetoothctl scan on
I was able to:
bluetoothctl pair XX:XX:XX:XX:XX:XX
bluetoothctl trust XX:XX:XX:XX:XX:XX
bluetoothctl connect XX:XX:XX:XX:XX:XX
NOTE This didn’t work the first time I tried it. I used
bluetoothctl remove XX:XX:XX:XX:XX:XXandsudo systemctl restart bluetoothto reset the bluetooth service and then it worked subsequently.
gilrs includes a code example that enumerates (connected) “gamepad” devices (i.e. the joystick) and reports events (joystick movements and button presses):
Microsoft X-Box 360 pad is Wired
OS Name: Microsoft X-Box 360 pad
Vendor ID: 0x045e
Product ID: 0x028e
ButtonPressed(DPadDown, Code(EvCode(EvCode { kind: 1, code: 545 })))
ButtonChanged(DPadDown, 1.0, Code(EvCode(EvCode { kind: 1, code: 545 })))
ButtonReleased(DPadDown, Code(EvCode(EvCode { kind: 1, code: 545 })))
ButtonChanged(DPadDown, 0.0, Code(EvCode(EvCode { kind: 1, code: 545 })))
ButtonPressed(DPadUp, Code(EvCode(EvCode { kind: 1, code: 544 })))
ButtonChanged(DPadUp, 1.0, Code(EvCode(EvCode { kind: 1, code: 544 })))
ButtonReleased(DPadUp, Code(EvCode(EvCode { kind: 1, code: 544 })))
ButtonChanged(DPadUp, 0.0, Code(EvCode(EvCode { kind: 1, code: 544 })))
Next step is to pair this code with enigo in an attempt to convert the events received from the joystick into mouse movements.