joy2script/joy2script.1
2012-02-08 22:04:30 -08:00

107 lines
3.4 KiB
Groff

.TH JOY2SCRIPT 1 "03 June 2008"
.SH NAME
joy2script \- perform actions based on joystick events
.SH SYNOPSIS
.B joy2script
Usage: joy2script
[ -dev {/dev/js0} ]
[ -config {.joy2scriptrc} ]
note: [] denotes `optional' option or argument,
() hints at the wanted arguments for options
{} denotes default (compiled-in) parameters
(note: defaults may have been changed by editing joy2script.c)
.SH DESCRIPTION
.I joy2script
monitors the joystick (normally /dev/js0) and takes action based on the
events recieved. The actions are defined in the config file (normally
~/.joy2scriptrc).
.P
The joy2script homepage is located at:
http://www.brianhrebec.net/joy2script
.SS Options
.TP
.B -dev
Specifies joystick device to use. Defaults /dev/js0 (first joystick)
.TP
.B -config
Specifies the config file to use.
.SH FILES
.I /dev/input/js[01]
The joystick driver. Must be installed for joy2script to work.
.PP
.I ~/.joy2scriptrc
joy2script config file.
.SH CONFIG FILE FORMAT
Example:
.P
.br
##################
.P
[mode 0]
.br
[axis 0]
.br
action_on = echo axis
.P
[button 0]
.br
action_on = echo button 0
.P
[button 1]
.br
action_on = echo button 1
.P
##################
.P
For a full example, see joy2scriptrc.example
.P
Note that an action can be any valid shell command.
Within the axis (but not button) action string, the following substitutions will be made:
.HP
%v - the value of the axis scaled between output_low and output_high.
.HP
%s - the 'sign' of the axis value, that is, -1 if the value is negative, +1 if it is positive
.P
Axis options:
.HP
action_on = <action> - the action taken when the axis is moved over the deadzone.
.HP
action_off = <action> - the action taken when the axis is moved under the deadzone.
.HP
repeat = N - if n is 0 (the default), the action only occur once over the deadzone. Otherwise, it will repeat according to repeat_rate. If both repeat_rate_low and repeat_rate_high are 0, the action will repeat every time the joystick generates new data.
.HP
repeat_rate_low = N - sets the repeat rate (in milliseconds per action) when the joystick is at 0. Note that this will usually be set higher than repeat_rate_high for intutive behavior.
.HP
repeat_rate_high = N - sets the repeat rate (in milliseconds per action) when the joystick is at (+ or -)32767, or 65536 for asymmetric mode.
.HP
repeat_rate = N - sets repeat_rate_high and repeat_rate_low to the same value.
.HP
asymmetric = 1 - changes the joystick range from -32767-32768 to 0-65536. Useful for a throttle axis.
.HP
deadzone = N - defaults to 100. Sets the line between off and on.
.HP
deadzone_size = N - defaults to 50. Change the position of the deadzone by half this amont depending on which direction it is being crossed. Useful to prevent the stick from toggling on and off rapidly near the deadzone.
.HP
output_low = N - default 0. Sets the %v value when the joystick is at 0.
.HP
output_high = N - default 32767. Sets the %v value when the joystick is at maximum value.
.P
Button options:
.HP
action <action> - the action taken when the button is pressed or held.
.HP
action_off <action> - the action taken when the button is released.
.HP
repeat_rate = N - default 0 (disabled). Sets repeat_rate for the button.
.P
.SH BUGS
Probably lots, but nothing specific.
.SH COPYING
This is free software under the GNU General Public License. See COPYING in the archive
for more information.