diff --git a/README b/README index 1931d3e..fbe7098 100644 --- a/README +++ b/README @@ -44,6 +44,7 @@ spacenavd - $Rev$ use the graphical spnavcfg program to interactively set any of these options. The daemon should respond immediately to your changes, and also the configuration file should be updated automatically. + An example configuration file is included in the doc subdirectory. 6. Troubleshooting If you're having trouble running spacenavd, read the up to date FAQ on the diff --git a/doc/example-spnavrc b/doc/example-spnavrc new file mode 100644 index 0000000..964b343 --- /dev/null +++ b/doc/example-spnavrc @@ -0,0 +1,42 @@ +# This is an example configuration file for spacenavd. Uncomment and change +# any settings you need and copy it to /etc/spnavrc. +# +# Note that it's much easier to configure sensitivities and figure out axis +# reversals by using the interactive configure utility "spnavcfg", which lets +# you fiddle with all the settings and see the result immediately. +# +# Lines that start with a `#' are comments, and are ignored by spacenavd. + + +# Sensitivity is multiplied with every motion (1.0 normal). +#sensitivity = 1.0 + + +# Separate sensitivity for rotation and translation. +#sensitivity-translation = 1.0 +#sensitivity-rotation = 1.0 + + +# Dead zone; any motion less than this number is discarded as noise. +#dead-zone = 2 + + +# Selectively invert translation and rotation axes. Valid values are +# combinations of the letters x, y, and z. +#invert-rot = yz +#invert-trans = yz + + +# Swap Y and Z axes +#swap-yz = false + + +# Serial device +# Set this only if you have a serial device, and make sure you specify the +# correct device file. If you do set this option, any USB devices will be +# ignored! +#serial = /dev/ttyS0 + + +# Enable/disable LED light (for devices that have one). +#led = on diff --git a/src/cfgfile.c b/src/cfgfile.c index cb1be48..1e13a12 100644 --- a/src/cfgfile.c +++ b/src/cfgfile.c @@ -240,9 +240,13 @@ int write_cfg(const char *fname, struct cfg *cfg) fprintf(fp, "led = 0\n\n"); } + fprintf(fp, "# serial device\n"); + fprintf(fp, "# Set this only if you have a serial device, and make sure you specify the\n"); + fprintf(fp, "# correct device file (On linux usually: /dev/ttyS0, /dev/ttyS1, /dev/ttyUSB0 ... etc).\n"); if(cfg->serial_dev[0]) { - fprintf(fp, "# serial device\n"); fprintf(fp, "serial = %s\n\n", cfg->serial_dev); + } else { + fprintf(fp, "#serial = /dev/ttyS0\n"); } /* unlock */