mirror of
https://git.freebsd.org/ports.git
synced 2025-06-20 12:10:31 -04:00
- USB joystick support has been added - Calling select() with a large timeout did not work properly: fixed - Short reads (< sizeof(struct js_event)) did not work: fixed - The JSIOCGCORR/JSCIOCSCORR ioctls now handle all the axes - Each joystick is now presented as a separate js device - A manual page has been added
42 lines
858 B
Bash
42 lines
858 B
Bash
#!/bin/sh
|
|
# $FreeBSD$
|
|
|
|
# PROVIDE: jscal
|
|
# REQUIRE: linux_js
|
|
# KEYWORD: shutdown
|
|
|
|
jscal_enable=${jscal_enable-"NO"}
|
|
jscal_devices="${jscal_devices:-/dev/input/js*}"
|
|
jscal_state="${jscal_state:-/var/db/jscal-state}"
|
|
|
|
. %%RC_SUBR%%
|
|
|
|
name="jscal"
|
|
rcvar=`set_rcvar`
|
|
command="%%PREFIX%%/bin/jscal"
|
|
start_cmd="jscal_start"
|
|
stop_cmd="jscal_stop"
|
|
|
|
jscal_start()
|
|
{
|
|
echo "Starting ${name}."
|
|
for d in $jscal_devices; do
|
|
[ "x$d" = "x$jscal_devices" ] && break
|
|
statefile="$jscal_state-`basename $d`"
|
|
[ -f "$statefile" ] && . "$statefile" 2>/dev/null
|
|
done
|
|
}
|
|
|
|
jscal_stop()
|
|
{
|
|
echo "Stopping ${name}."
|
|
for d in $jscal_devices; do
|
|
[ "x$d" = "x$jscal_devices" ] && break
|
|
statefile="$jscal_state-`basename $d`"
|
|
cal=`"$command" -p "$d" 2>/dev/null` && \
|
|
echo "$cal" | sed -e "s|^jscal|$command|" > "$statefile"
|
|
done
|
|
}
|
|
|
|
load_rc_config $name
|
|
run_rc_command "$1"
|