Allows mouse input via the Ks0008 Joystick module from Keyes using serial instead of HID, since Arduino Uno is being used for this project and it doesn't have support for it.
This code is for a school project so it may not be polished or may not work every time.
+5Von5V-onGNDXonA0YonA1SWorBon digital 2
Tested under Windows and Linux.
-
Clone this repo or download source
-
Allow serial usage on Linux if needed
-
Upload the code under
src/joystickto your Arduino. -
Once uploaded, install the Python dependencies at
requirements.txtand runsrc/driver/driver.pyfor making the joystick work.
- Using
230400baud for faster transfer rates, please lower the value in driver and Arduino code if serial driver cannot handle such rate. - Change the sensibility under driver
SENSIvariable if needed. Default is480.0. - On Windows, change the serial port on driver code to
COM3orCOM4. Try restarting your computer if it doesn't recognize the Arduino. - On Linux, the Python driver only works under X11. Wayland is not supported.
- If using Wayland anyway, only legacy applications will support mouse clicking and movement will not work.
TODO: Wayland support??
2025 Lucas Gabriel (lucmsilva). Licensed under the BSD 3-Clause.
