Python script that can use your 3D mouse as Trackpoint, kind of.
- waiting for USB device to connect, when it does,
- check if it is 3D mouse compatible device (device support by Kuba Andrýsek)
- when disconnected, it will wait for new connection again
- move cursor around: Up, Down, Left, Right
- left and right clicks like in real mouse
- scroll up/down by using yaw (angle on the XY plane)
- zoom-in/zoom-out by using z-axis (emulating CTRL + '+'|'-')
- sensitivity can be changed by 'zoom_sens' variable; greater the number = greater force required
- horizontal scroll (left/right) by: pushing (negative z-axis) and then move on x-axis will corespond to movement
- sensitivity can be changed by 'hs_sens' variable; greater the number = more movement per 1 scroll point is required
# make sure you have these apt install python3-dev apt install python3-uinput apt install python3-evdev apt install python3-venv # create and load virtual environment python3 -m venv venv source venv/bin/activate # install dependencies inside virtual environment pip install python-uinput pip install easyhid pip install evdev pip install pyudev # make sure kernel module is loaded modprobe uinput # it should be ready to run python3 trackpoint.py
The package can be run directly to convert 3D mouse input into simulated input events:
python3 trackpoint.py
uinput(python-uinput 1.0.1)evdev(1.9.1)easyhidpyudev- Python standard library (time, collections, etc.)
- SpaceMouse Enterprise
- SpaceExplorer
- SpaceNavigator
- SpaceMouse USB
- SpaceMouse Compact
- SpaceMouse Pro Wireless
- SpaceMouse Pro
- SpaceMouse Wireless
- 3Dconnexion Universal Receiver
- SpacePilot
- SpacePilot Pro
Huge Thanks to Kuba Andrýsek for the code regarding reading 3D mouse data, which was taken from his project pySpaceMouse.
is not supported by this project, however you can run this script after start. Script will run until interrupted, waiting for supported device to connect and using it. When disconnected it will wait for new connection.