#!/bin/sh
if [ "$1" = "stop" -o "$1" = "restart" ]
then 
. /etc/rc.d/init.d/mainApp $1
else
echo "checking F Keys"
/home/KeypressDetector seaward-keyboard
Key=$?
F1=$((${Key} & 1))
F1=$((${F1} == 1))
F2=$((${Key} & 2))
F2=$((${F2} == 2))
F3=$((${Key} & 4))
F3=$((${F3} == 4))
F4=$((${Key} & 8))
F4=$((${F4} == 8))
F5=$((${Key} & 16))
F5=$((${F5} == 16))
echo "F1 = ${F1}"
echo "F2 = ${F2}"
echo "F3 = ${F3}"
echo "F4 = ${F4}"
echo "F5 = ${F5}"
if [ ${F1} = 0 ]
then
	if [ -e /home/mainApp ]
	then
		. /etc/rc.d/init.d/mainApp $1 ${F4}
	fi
else
	echo "F1 key down, skipping app - updater should launch"
fi
fi
