Last active
August 16, 2020 21:15
-
-
Save gcoda/2a893e80077487e630fb726a29d9d4ba to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/sh | |
# i am not very good with bash, but looks like its working fine | |
######################################################## | |
# | |
# evtest /dev/input/event14 | ./4click.sh 'notify-send tap4' | sh | |
# | |
######################################################## | |
cancelTap=true | |
while read -r line; do | |
IFS=" " | |
eventArray=($line) | |
touchEvent=${eventArray[8]} | |
touchValue=${eventArray[10]} | |
touchTime=${eventArray[2]} | |
needleEvent="(BTN_TOOL_QUADTAP)," | |
cancelEvent="(ABS_MT_POSITION_X)," | |
if [ x"$touchEvent" == x"$cancelEvent" ]; then | |
cancelTap=true | |
fi | |
if [ x"$touchEvent" = x"$needleEvent" ]; | |
then | |
#tapTime=${touchTime##*.} | |
if [ x"$touchValue" == x"0" ]; then # fingersUp | |
if ! $cancelTap; then | |
echo "$1" | |
fi | |
fi | |
if [ x"$touchValue" == x"1" ]; then # fingersDOWN | |
cancelTap=false | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment