OpenSCAD User Manual/WIP/Inputdriver
- 1 Introduction
- 2 How to try it out
- 3 Joystick and gamepads
- 4 3D-Mouse
- 5 DBus
- 6 FAQ
- 7 Development
The inputdriver is currently in development in a separate development branch, so it is not part of the current development snapshots.
The inputdriver allows a user the use of things like a gamepad or a 3D-Mouse in OpenSCAD.
Currently, the following drivers are in development:
- HIDAPI - Used on MacOS and Windows - needs the USB IDs / it works on Linux too, but needs additional privileges, so it's not ideal for the user
- Joystick driver - uses the Linux joystick device (currently fixed /dev/input/js0)
- SpaceNav driver - using the spacenavd daemon
- DBus driver - Linux only / not for actual devices but for remote control
- QGamepad - used for Cross-platform joystick support - This seems to require some additional configuration on Qt level currently, so it needs some more work to make it easy to use
The default axis mapping is for 3D-mices.
How to try it out
The feature is experimental and not yet offically integrated (although we are getting close). There are separate builds needed from the github branch inputdriver5.
The feature needs to be enabled in the Preferences -> Features panel (check 'input-driver' box) and after restarting OpenSCAD the configuration panels should show up in Preferences.
Easiest way to try out would be using one of the Linux AppImages (x86_64, armv7l, aarch64). Those links always points to the latest build for Linux and supports currently the Joystick based driver (which also works with the 3D Mouse, but needs the spacenavd driver to be not running).
With a recent Linux distribution it should be simply
- Download the AppImage
- chmod 755 OpenSCAD-Branch-InputDriver-latest-x86_64.AppImage
- Run with ./OpenSCAD-Branch-InputDriver-latest-x86_64.AppImage
From time to time there are snapshots built for Windows. Those can be downloaded from the OpenSCAD file server in the snapshots folder.
There's currently no snapshot builds available, please ask on the forum/mailing list if you would like to try this feature on MacOS.
Joystick and gamepads
The JoystickInputDriver is using the device /dev/input/js0.
Under Ubuntu Linux, you need the packet joystick for joystick support.
QGamepad can also be used, but is not recommended as the QGamepad Driver makes assumptions about the Gamepad that might not be true.
Under Windows, you can use QGamepad as a driver.
On Linux, the easiest way with the Space Mouse Wireless is interestingly to go though the Joystick driver which is normally enabled on most systems.
Spacenav is also supported. http://spacenav.sourceforge.net/ https://wiki.archlinux.org/index.php/3D_Mouse#Open_Source_Drivers
sudo apt-get spacenavd
sudo apt install libspnavd-dev
OpenSCAD interacts directly with the 3D Mouse using the HIDAPI.
Therefore, the driver from the device manufacturer is not required. If the driver of the device manufacturer is installed, the driver has to be stopped, so that OpenSCAD can claim the device.
There are different ways to stop the driver. In your start menu you should have a folder 3Dconnexion and in there "Stop Driver".
You can also try
"C:\Program Files\3Dconnexion\3DxWare\3DxWinCore64\3DxService.exe" -shutdown
The D-Bus driver can be used for remote controlling OpenSCAD. This is mainly intended for programmers. It can for example be used to write a custom input driver.
Debug and testing
For debugging and testing, D-Feet can be used. OpenSCAD can be found on the Session Bus under org.openscad.OpenSCAD.
qdbus is NOT recommended, as it has issues with some of the more complex data structures.
An example for QT/C++ can be found under this page.
Note that OpenSCADs camera behavior and system does not operate in a standard way. Via DBus, you are directly interacting OpenSCADS camera. Note that the camera system and thus this is interface could be refractored at some point.
Please note that the actions exposed Via dbus are mostly the ones from the Menu Bar of OpenSCAD. Keep in mind, that the menubar might change at some point and that compatibility with the dbus driver is not of concern.
Open the preferences, then go to the button tab then press the button you want to assign. The text next to the relevant ComboBox will be shown in red, bold text.
View is drifting
If your view is drifting, please recalibrate the neutral position and deadzone of your input device. This can be done within OpenSCAD or with the tools of the operating system.
Where are my settings stored?
See this page.