06-19-2017, 09:11 PM
(This post was last modified: 06-19-2017, 11:03 PM by MarkHaysHarris777.)
The following script assumes that "xinput" is installed; it is installed on the original image but may not be present in the newer image. To check try:
sudo xinput list
To install try:
sudo apt-get install xinput
The following script has been modified to run on the 14" pinebook. It may have to be modified again for the 11.6" pinebook;
touchpad.sh
To disable the touchpad:
./touchpad.sh off
To enable the touchpad:
./touchpad.sh on
Notes: It may be necessary to run the script with sudo.
I just spoke with Pete, looks like the 11.6" hardware also reports as HAILUCK co.ltd pointer, also device 8 by default; so this script should also run on the 11.6" touchpad, although I have not tried it yet Pete just successfully tested the script on his 11.6" pinebook with good results, unmodified.
The tap-to-click feature is a hardware feature of the touchpad; essentially, tap-to-click is a "button-1" event ! In order to disable it you would have to change the mouse properties so that button-2 is button-1, and button-1 is not active (ignored).
sudo xinput list
To install try:
sudo apt-get install xinput
The following script has been modified to run on the 14" pinebook. It may have to be modified again for the 11.6" pinebook;
touchpad.sh
Code:
#! /bin/sh
# touchpad.sh
#
# Mark H. Harris
# 2014/08/07
# 2017/06/19 (pinebook port)
#
# Enable or Disable the TouchPad based on xinput
#
# notes: assumes 'one' touchpad
# assumes xinput see man xinput
#
# usage:
# touchpad on|1 (enables)
# touchpad off|0 (disables)
#
#
# get the touchpad device number TDEVICE
for line in $(xinput list |grep -i "hailuck" |grep -i "pointer"); do
for word in $(echo $line |grep -i "id"); do
TDEVICE=$(echo $word |cut -d'=' -f2)
done
done
# get Device Enabled status for touchpad
for line in $(xinput --list-props $TDEVICE |grep "Device Enabled"); do
TPRESTAT=$(echo $line |cut -d':' -f2 |cut -d' ' -f2)
done
# set prestatus keyword based on numerical data
if [ "$TPRESTAT" = "1" ]; then
PSTATUS="enabled"
elif [ "$TPRESTAT" = "0" ]; then
PSTATUS="disabled"
else
PSTATUS="unknown"
fi
# get the touchpad name by device number
TNAME=$(xinput list --name-only $TDEVICE)
# turn enable or disable the device per input parms
echo " "
if [ "$1" = "on" ] || [ "$1" = "1" ]; then
xinput --enable $TDEVICE
echo "Enabling" $TNAME "ID="$TDEVICE "..."
echo " "
elif [ "$1" = "off" ] || [ "$1" = "0" ]; then
xinput --disable $TDEVICE
echo "Disabling" $TNAME "ID="$TDEVICE "..."
echo " "
else
echo $TNAME "ID="$TDEVICE "(currently "$PSTATUS")"
echo " "
echo "touchpad on (enables)"
echo "touchpad off (disables)"
echo " "
fi
# get current Device Enabled status for touchpad
for line in $(xinput --list-props $TDEVICE |grep "Device Enabled"); do
TCURSTAT=$(echo $line |cut -d':' -f2 |cut -d' ' -f2)
done
# display status of touchpad if the status has changed
if [ "$TCURSTAT" = "1" ]; then
TSTATUS="enabled"
elif [ "$TCURSTAT" = "0" ]; then
TSTATUS="disabled"
else
TSTATUS="unknown"
fi
if [ $PSTATUS != $TSTATUS ]; then
echo "Device Status:" $TNAME "ID="$TDEVICE "("$TSTATUS")"
echo " "
else
echo "TouchPad Status ("$TSTATUS") Unchanged"
echo " "
fi
To disable the touchpad:
./touchpad.sh off
To enable the touchpad:
./touchpad.sh on
Notes: It may be necessary to run the script with sudo.
I just spoke with Pete, looks like the 11.6" hardware also reports as HAILUCK co.ltd pointer, also device 8 by default; so this script should also run on the 11.6" touchpad, although I have not tried it yet Pete just successfully tested the script on his 11.6" pinebook with good results, unmodified.
The tap-to-click feature is a hardware feature of the touchpad; essentially, tap-to-click is a "button-1" event ! In order to disable it you would have to change the mouse properties so that button-2 is button-1, and button-1 is not active (ignored).
marcushh777
please join us for a chat @ irc.pine64.xyz:6667 or ssl irc.pine64.xyz:6697
( I regret that I am not able to respond to personal messages; let's meet on irc! )
please join us for a chat @ irc.pine64.xyz:6667 or ssl irc.pine64.xyz:6697
( I regret that I am not able to respond to personal messages; let's meet on irc! )