Skip to content

About

Plasma-native control panel, tray daemon and per-application profiles for 3Dconnexion SpaceMouse devices, built on spacenavd. Qt 6, Kirigami, KDE Frameworks 6.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

kspacemouse: your 3Dconnexion SpaceMouse, at home on KDE Plasma 6

CI Latest release Last commit status: work in progress KDE Plasma 6 Qt 6 licence OBS build status REUSE compliant

A Plasma-native control panel, tray daemon and per-application profiles for 3Dconnexion SpaceMouse devices.
Built on spacenavd, so Blender, FreeCAD and every other spnav client keep working.

The 3D Mouse module in System Settings: the 3D test view and the Profiles page

Why

On Linux the SpaceMouse story is three separate pieces: a driver daemon (spacenavd), a plain Qt configuration tool (spnavcfg) and a Python bridge for browser CAD. None of them feels like part of the desktop. kspacemouse aims at the experience of the Windows 3Dconnexion driver, but done the Plasma way: a page in System Settings, a tray icon, settings that follow the application you are working in, and later radial menus, macros and a built-in Onshape bridge.

Status: early (0.4). The settings module, the daemon, per-application profiles, button actions and macros, and the Onshape bridge work, and are tested on real hardware (a SpaceMouse Wireless over Bluetooth). Packages for several distributions build on the openSUSE Build Service (see Installing). The radial menu is still ahead; see the roadmap.

What works today

  • 🎛️ A real System Settings module, "3D Mouse": sensitivity, dead zones, inversion, axis remapping, Swap Y/Z, button mapping, LED, key repeat. Try changes live, then save them to spacenavd's own config file. No root helper needed.
  • 🧊 A live 3D test view: fly a cube with the puck as a CAD program would (slide to move it across the screen, push and pull to send it away or bring it closer, tilt and twist to turn it) in the isometric view a CAD program resets to (Z up, same axes and colours as Onshape) over a ground plane like a slicer's bed, next to a 3D model of your device that tilts with the real puck and lights its buttons. Feel what a setting does before you apply it.
  • 🪟 Per-application profiles: Blender gets one sensitivity, Orca Slicer another. A profile changes only the motion settings you tick while its application has focus, then puts everything back. "Use the Window I'm In…" picks the application for you, and "From template" starts a profile for Blender, Bambu Studio, OrcaSlicer or PrusaSlicer with the tuning 3Dconnexion's own driver uses for them (Blender damps rotation; slicers zoom far less than they pan).
  • 🔘 Buttons that do things on the desktop: press a key combination, click, scroll, run a program or play a short macro, everywhere or only while a given application has focus. See Making buttons do things.
  • 🌐 A web bridge for browser CAD: move the view in Onshape with the puck, with no Python service, userscript or browser extension. Off until you switch it on; only the websites and applications you list can connect. See Using it with Onshape.
  • 🔔 A tray daemon that follows spacenavd across restarts and hot-plugging, shows the active profile, notifies you when the device connects or goes away, and exposes its state on D-Bus (org.kde.kspacemouse).
  • 🧪 Tested, not hoped for: nearly 500 automated test cases against a fake spacenavd, many of them checked by deliberately breaking the code and seeing a test fail.

A look around

Overview tab
Overview: device, daemon, profile, bridge and actions at a glance
Test tab
Test: six axes and the buttons, live
3D View tab
3D View: fly the test object
Motion tab
Motion: per-axis sensitivity, dead zone, invert, remap
Buttons tab
Buttons: remap, built-in actions, keys
Profiles tab
Profiles: per-application motion and buttons, templates
Device tab
Device: LED, grab, key repeat, save and restore
Bridge tab
Bridge: browser CAD such as Onshape, allowed sites, speeds
Actions tab
Actions: keys, clicks, scrolling, commands and macros

Installing from the build service

Packages are built on the openSUSE Build Service (project home:emendonca:kspacemouse) for openSUSE Tumbleweed and Leap 16.0, Fedora 43 and 44, Debian 13, Ubuntu 25.10 and 26.04, and Arch. Pick your system, paste the block, then follow After installing. The repositories are signed with the project key, fingerprint 7F0B E066 4FD8 9DC8 70EC 7D43 8E95 5315 2D76 C052.

The Debian, Ubuntu and Arch packages build cleanly but have not been tried on those systems yet; reports are welcome.

openSUSE Tumbleweed

sudo zypper addrepo --refresh https://download.opensuse.org/repositories/home:/emendonca:/kspacemouse/openSUSE_Tumbleweed/home:emendonca:kspacemouse.repo
sudo zypper --gpg-auto-import-keys refresh
sudo zypper install kspacemouse

openSUSE Leap 16.0

sudo zypper addrepo --refresh https://download.opensuse.org/repositories/home:/emendonca:/kspacemouse/openSUSE_Leap_16.0/home:emendonca:kspacemouse.repo
sudo zypper --gpg-auto-import-keys refresh
sudo zypper install kspacemouse

Fedora 43 or 44

# use Fedora_43 instead of Fedora_44 on Fedora 43
sudo dnf config-manager addrepo --from-repofile=https://download.opensuse.org/repositories/home:/emendonca:/kspacemouse/Fedora_44/home:emendonca:kspacemouse.repo
sudo dnf install kspacemouse

Debian 13

REPO=https://download.opensuse.org/repositories/home:/emendonca:/kspacemouse/Debian_13
curl -fsSL $REPO/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/home_emendonca_kspacemouse.gpg >/dev/null
echo "deb $REPO/ /" | sudo tee /etc/apt/sources.list.d/home_emendonca_kspacemouse.list
sudo apt update
sudo apt install kspacemouse

Ubuntu 25.10 or 26.04

# use xUbuntu_26.04 instead of xUbuntu_25.10 on Ubuntu 26.04
REPO=https://download.opensuse.org/repositories/home:/emendonca:/kspacemouse/xUbuntu_25.10
curl -fsSL $REPO/Release.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/home_emendonca_kspacemouse.gpg >/dev/null
echo "deb $REPO/ /" | sudo tee /etc/apt/sources.list.d/home_emendonca_kspacemouse.list
sudo apt update
sudo apt install kspacemouse

Arch Linux

spacenavd is not in the official repositories; install it from the AUR first (for example yay -S spacenavd).

curl -fsSL https://download.opensuse.org/repositories/home:/emendonca:/kspacemouse/Arch_Extra/x86_64/home_emendonca_kspacemouse_Arch_Extra.key | sudo pacman-key --add -
sudo pacman-key --lsign-key 7F0BE0664FD89DC870EC7D438E9553152D76C052
printf '\n[home_emendonca_kspacemouse_Arch_Extra]\nServer = https://download.opensuse.org/repositories/home:/emendonca:/kspacemouse/Arch_Extra/$arch\n' | sudo tee -a /etc/pacman.conf >/dev/null
sudo pacman -Sy kspacemouse

After installing

# 1. The driver that talks to the device (the package depends on it; on Arch it comes from the AUR)
sudo systemctl enable --now spacenavd

# 2. Let the logged-in user create the virtual keyboard and mouse that button actions use
sudo udevadm control --reload && sudo udevadm trigger --subsystem-match=misc --sysname-match=uinput

# 3. The tray daemon, for your user (it then starts with every graphical session)
systemctl --user enable --now kspacemouse-daemon.service

# 4. Open the settings: System Settings > Input Devices > 3D Mouse, or
kcmshell6 kcm_kspacemouse

If System Settings does not list the 3D Mouse page yet, restart it (kquitapp6 systemsettings, then start it again). If button actions say they cannot send input, log out and in once so the udev rule's access applies to your session. The Onshape bridge stays off until you switch it on in the Bridge tab.

Updating and removing

Updates arrive with your normal system updates. To remove kspacemouse and its repository:

# openSUSE
sudo zypper remove kspacemouse && sudo zypper removerepo home_emendonca_kspacemouse
# Fedora
sudo dnf remove kspacemouse && sudo rm /etc/yum.repos.d/*emendonca*kspacemouse*.repo
# Debian and Ubuntu
sudo apt remove kspacemouse && sudo rm /etc/apt/sources.list.d/home_emendonca_kspacemouse.list /etc/apt/trusted.gpg.d/home_emendonca_kspacemouse.gpg
# Arch: delete the [home_emendonca_kspacemouse_Arch_Extra] block from /etc/pacman.conf, then
sudo pacman -R kspacemouse

Prefer to build it yourself? See Install for building from source, and packaging/ for the spec, Debian files and PKGBUILD.

Making buttons do things

Open System Settings → 3D Mouse → Actions: one row per device button. Choose what it does:

Action Example
Press keys ctrl+shift+z, or f5. Tap presses and releases; Hold keeps the keys down while the button is down
Click left, middle or right; Hold for drag-like use
Scroll up, down, left or right by some notches; Keep scrolling repeats while the button is held
Run a command firefox --new-window, notify-send "two words". Words split on spaces, double quotes group, it is run directly and never through a shell
Macro ctrl+a; wait 100; ctrl+c; click left; scroll down 2: up to 32 steps, pauses up to 5 s

Changes apply at once. To make a button behave differently in one application, use the Profiles tab: Buttons while it applies lets each button be Same as everywhere, Nothing (switch the global action off in that application) or any of the actions above; it is saved with Apply like the rest of the profile.

Good to know:

  • Input is sent through a virtual keyboard-and-mouse device made with /dev/uinput, created the first time an action runs. The installed udev rule (70-kspacemouse-uinput.rules) gives the person at the machine access; if it is missing the Actions tab says why input cannot be sent. Keys are physical keys (what your layout makes of them is up to the desktop).
  • Who handles a button: a web page the bridge is driving keeps the buttons (so Onshape's own button commands are not disturbed), and a button spacenavd binds itself (Buttons tab) stays spacenavd's, the Actions tab says so. Everything else is yours.
  • Passing a button through to an application (Blender, FreeCAD and other spacenav-aware programs read the buttons themselves) needs nothing special: leave it as Nothing, or choose Nothing in that application's profile.
  • Nothing is left stuck: held keys are released when the button comes up, the daemon is paused, the device goes away, the profile changes or the daemon quits.

Using it with Onshape

Browser-based CAD programs talk to a local "3Dconnexion service". kspacemouse includes one, built into its daemon.

  1. Open System Settings → 3D Mouse → Bridge and switch Enable the web bridge on (or tick it in the tray menu).
  2. Click Open the bridge address in the browser and accept the security warning once. The page it opens says "KSpaceMouse bridge". The certificate was made on your computer (in ~/.local/share/kspacemouse/bridge) and is only valid for the bridge's own address, 127.51.68.120. Do this in each browser you use; some browsers ask again after a while.
  3. Reload your Onshape document, click in the model view and move the puck. Push and pull zoom, lift slides the view, tilt and twist turn it. Button 1 runs a useful Onshape command for where you are (Sketch in the Part Studio, Dimension while sketching, Insert in an Assembly) and button 2 resets the view to the front. Change them on the Bridge tab, What the buttons do; Use the suggested buttons puts the defaults back.

Good to know:

  • It only talks to this computer, on 127.51.68.120:8181, and only to the websites listed on the Bridge tab (Onshape by default; wildcards are refused). Removing a site disconnects its pages at once.
  • Speeds follow the size of your model. Three sliders (moving, turning, zooming) let you tune them; they apply live.
  • To practise, a free browser game such as DRIFT//LOCK (made by someone else) uses the same connection and is on the default list.
  • Other web apps that use 3Dconnexion's web protocol may work too; add the website under Websites allowed to connect and the name the page announces under Applications allowed to be driven.
  • If something misbehaves, QT_LOGGING_RULES="kspacemouse.bridge.debug=true;kspacemouse.bridge.wamp.debug=true" (set for the daemon, for example with systemctl --user set-environment) logs timings and the whole conversation with the page.

How it fits together

 SpaceMouse ──(HID)──▶ spacenavd (system service, unchanged)
                          │  spnav socket
          ┌───────────────┴───────────────┐
          ▼                               ▼
 kspacemouse-daemon (user session)   System Settings ▸ "3D Mouse" (Kirigami module)
  · tray icon + notifications         · talks to spacenavd directly for settings
  · profile engine + live applier     · edits profiles.json, picks windows via D-Bus
  · D-Bus: org.kde.kspacemouse        · saves with profiles suspended, so a profile's
          ▲                              values never reach /etc/spnavrc
          │ D-Bus (focused window)
   KWin script (loaded by the daemon)

Some choices worth knowing about:

  • spacenavd stays the device layer. kspacemouse speaks its socket protocol natively in Qt (no libspnav wrapper) and never replaces it.
  • No privileged helper. spacenavd runs as root and writes its own config file when asked.
  • Profiles are live only. They never write to spacenavd's config; stopping the daemon puts your settings back.
  • Wayland first. The focused window comes from a small KWin script, not X11.

Install

You need Qt 6, KDE Frameworks 6 (KCMUtils, Kirigami, StatusNotifierItem, Notifications, I18n, CoreAddons, DBusAddons), extra-cmake-modules and xkbcommon to build, and spacenavd installed and running. The 3D views use Qt Quick 3D at runtime (qt6-quick3d) and fall back to a flat drawing without it. On openSUSE Tumbleweed see the package list in .github/workflows/ci.yml; it is exactly what the automated build installs.

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
cmake --build build -j
ctest --test-dir build            # optional: about 250 tests, none need a SpaceMouse

sudo cmake --install build        # the daemon, the System Settings module, the KWin script, a systemd user unit
systemctl --user enable --now kspacemouse-daemon.service

Then open System Settings and search for 3D Mouse (restart System Settings if it was open). The daemon starts with your session from now on; its tray icon shows the active profile.

The prefix should be /usr so Plasma finds the module and the notification definitions without extra environment settings. To update, rebuild, sudo cmake --install build again and systemctl --user restart kspacemouse-daemon. To remove everything:

systemctl --user disable --now kspacemouse-daemon.service
sudo cmake --build build --target uninstall

(uninstall removes exactly the files listed in build/install_manifest.txt; an automated test checks the install layout and the uninstall, including that the systemd unit points at the installed binary.)

Without installing

build/bin/kspacemouse-daemon &                                  # tray icon and profiles
QT_PLUGIN_PATH=$PWD/build/bin kcmshell6 kcm_kspacemouse         # the module, straight from the build tree

build/bin/spnavprobe prints what spacenavd reports about your device, which is handy when something looks off.

Roadmap

  • Native spnav protocol client and typed configuration access
  • Daemon with tray icon, notifications and D-Bus interface
  • System Settings module: Overview, Test, 3D View, Motion, Buttons, Profiles, Device, Bridge, Actions
  • Per-application profiles with live motion overrides
  • Action engine and macros: key combinations, clicks, scrolling, commands, macros, per-profile button actions
  • Profile templates for Blender and the common slicers
  • Radial menu driven by the puck
  • Built-in web bridge for Onshape and other browser CAD (replacing the Python bridge and its userscript): works in Onshape and the DRIFT//LOCK game, off by default
  • Install target, systemd user service, uninstall, CI
  • udev rule for the action engine; packages on the openSUSE Build Service (openSUSE, Fedora, Debian, Ubuntu, Arch)
  • Overview tab (status at a glance, shortcuts, version and links)

Details and the reasoning behind each step are in PLAN.md.

Hardware and compatibility

Developed and tested against a SpaceMouse Wireless (Bluetooth) on KDE Plasma 6 / Wayland with spacenavd 1.4. Other models should work through spacenavd, but they are untested. Reports are welcome: please include the output of build/bin/spnavprobe.

Contributing

Issues and pull requests are welcome. Read CONTRIBUTING.md first; the short version is tests first, and every new file carries the licence header. Developer notes live in CLAUDE.md.

Licence

Source files are licensed GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL, following the KDE licensing policy. Build files are BSD-3-Clause; data files, notes and pictures are CC0-1.0. The project is REUSE-compliant and the texts are in LICENSES/.

Acknowledgements

Thanks to the FreeSpacenav project for spacenavd, libspnav and spnavcfg, whose behaviour this project builds on, and to the authors of spacenav-ws for showing how a browser CAD bridge can work.

3Dconnexion and SpaceMouse are trademarks of 3Dconnexion. kspacemouse is an independent open-source project and is not affiliated with or endorsed by 3Dconnexion.

About

Plasma-native control panel, tray daemon and per-application profiles for 3Dconnexion SpaceMouse devices, built on spacenavd. Qt 6, Kirigami, KDE Frameworks 6.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages