No description
  • Python 97.3%
  • JavaScript 2.7%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
sid 2eb28a859d
Some checks failed
Test / test (push) Has been cancelled
Add Rust rewrite plan doc
2026-08-20 07:38:33 -06:00
.github/workflows Try to auto publish again 2025-04-21 14:38:25 +02:00
additional Start using client's focus events to start and stop mouse stream 2025-04-21 22:00:42 +02:00
docs Add Rust rewrite plan doc 2026-08-20 07:38:33 -06:00
src/spacenav_ws Support Access-Control-Allow-Private-Network 2026-08-20 05:56:23 -06:00
.gitignore Start using client's focus events to start and stop mouse stream 2025-04-21 22:00:42 +02:00
LICENSE Initial commit 2021-01-20 21:26:42 +01:00
pyproject.toml Start using client's focus events to start and stop mouse stream 2025-04-21 22:00:42 +02:00
README.md Start using client's focus events to start and stop mouse stream 2025-04-21 22:00:42 +02:00
uv.lock Add auto publishing 2025-04-21 14:29:45 +02:00

Websockets exposer for the spacenav driver (spacenavws)

PyPI version Build Status License

Table of Contents

About

spacenavws is a tiny Python CLI that exposes your 3Dconnexion SpaceMouse over a secure WebSocket, so Onshape on Linux can finally consume it. Under the hood it reverseengineers the same traffic Onshapes Windows client uses and proxies it into your browser.

This lets you use FreeSpacenav/spacenavd on Linux with Onshape.

Prerequisites

  • uv/uvx or another Python env manager.
  • A running instance of spacenavd
  • A modern browser (Chrome/Firefox) with a userscript manager (Tampermonkey/Greasemonkey)

Usage

  1. Validate spacenavd
uvx spacenav-ws@latest read-mouse
# → should print spacemouse events
  1. Run the server and trust the cert
uvx spacenav-ws@latest serve

Now open: https://127.51.68.120:8181. When prompted, add a browser exception for the selfsigned cert.

  1. Install Tampermonkey and add the userscript

Install Tampermonkey. After installing, click this link for oneclick install of the script.

  1. Open an Onshape document and test your mouse!

Developing

git clone https://github.com/you/spacenav-ws.git
cd spacenav-ws
uv run spacenav-ws serve --hot-reload

This starts the server with Uvicorn's code watching / hot reload feature enabled. When making changes the server restarts and any websocket state is nuked, however, Onshape should immediately reconnect automatically! This makes for a very smooth and fast iteration workflow.