SpaceNavigator

This article is written for the SpaceNavigator but it should work with other 3D mouse in the Space-series produced by 3Dconnexion. Only applications that support 3D mouse device can work properly with this driver. For now, only blender support it in the portage tree.

Kernel configuration
To be able to use spacenavd used in this article you need to compile your kernel with input evdev support as well as with support for Logitech HID devices and Physical Interface Device support.

Pitfalls
The following troubles are rather easy to run into (and to get out of).

No response
The device cannot be managed by both Xorg and the spacenavd daemon at the same time, see modes of operation. If you get no reaction with Xorg verify that spacenavd is not running. Respectively, if the device doesn't work in Blender make sure the daemon is running and xinput is not listing the device.

Orientation / inverted axes
The place where the cable leaves the body marks the top orientation of the device as with a normal 2D mouse. If you position the device in a different position inverting certain axes may be necessary to obtain expected behavior.

Modes of operation
SpaceNavigator can be operated in two mutually exclusive modes:
 * 1) as a 2D mouse controlled by Xorg
 * 2) as a 3D mouse controlled by a particular application, e.g. Blender

xf86-input-evdev
You can use your SpaceNavigator as a mouse without any additional drivers except for Kernel Event Support and xf86-input-evdev with

Once you restart Xorg and unplug-replug the device you can list supported properties and current values:

These keys can be used to alter the current configuration, for example:

xf86-input-joystick
The evdev approach above provides an absolute pointer that always re-centers on the screen. For a relative pointer that works more like a pointing stick, use xf86-input-joystick instead.

The mouse buttons on the Z axis are mapped to unused keycodes which can be configured through Xkb as mouse keys: key  {        [     XF86User1KB ] }; key  {        [     XF86User2KB ] };

interpret XF86User1KB+AnyOfOrNone(all) { action= PtrBtn(button=1); };   interpret XF86User2KB+AnyOfOrNone(all) { action= PtrBtn(button=3); };

Mouse keys then can be enabled using xkbset:

With the above configuration it is quite usable as a mouse, only thing missing is middle click, not sure where to map that.

Firefox

 * Ctrl + left click opens links in a new tab as an alternative to middle click.
 * Shift + scroll navigates the history
 * Ctrl + scroll zooms the page

Blender
To enable SpaceNavigator support for Blender you need to enable use flag "ndof"

or

spacenavd
To get 3D mouse working properly you will need spacenavd.

After installing spacenavd you could check out the following file before starting anything, normally default values works for everyone.

When finished you can start the spacenavd with

or with systemd

And add it to start up as default with

or with systemd

You could also make udev start the daemon for you when a SpaceNavigator is plugged in:

spacenavd runs as the root user and must connect to the X server. Authentication is done via the MIT-MAGIC-COOKIE mechanism, consequently spacenavd must know about the cookie stored in the user's ~/.Xauthority file. One way to do this is via the xauth command:

Also see the # 10 in the spacenavd FAQ:

If everything worked correctly you should now have a working device in blender (it must be emerge with ndof useflag, or 3dmouse for older version).

Alternative x11 events
By default, the spacenavd daemon use the uevent mechanism but can alternatively use x11 socket to handle events. Most of the time, uevents should be enough to use the 3D mouse in supported applications but Xevents has one advantage, it's capable of handle proprietary driver protocol Magellan. But if your application doesn't run on top of X proprietary driver is useless. More information on What's wrong with the proprietary driver ? or What is provided by the spacenav project?, read the official FAQ (see links following).

If you want to use X events support, you must enable it with the X use flag on build time and the spacenavd daemon must be notified of this new protocol with

To start generating Spacenav X events by default you should add this command in your user startup scripts such as ~/.gnomerc or ~/.xinitrc.

Extra
Optionally you can add the following ebuild to configure dynamically the spacenavd.



The changes are immediately transmit to the spacenavd daemon that modify its behavior as requested.

External resources

 * Website of spacenav tools at SourceForge (libspnav, spacenavd, spnavcfg and other)
 * Official spacenav FAQ