[ZenFone 2 Q&A, Help & Troubleshooting] kokoko3k:
When changing resolution on my ze551ml, i lost the ability to use the capacitive buttons.

That's probably because the kernel driver uses hardcoded coordinates.

So one could modify the kernel itself and flash, but i've managed to use an userspace solution.

Unfortunately, this requires the use of "bash" and "evtest".

Bash is available to android without efforts, evtest may not, i did not checked.

This is not a problem to me, because i run a full archlinux chroot on my zenfone, but probably my script could be adapted to use android's getevent instead of evtest or could be as inspiration for further developing.

"grep" is used too, it is not strictly necessary, but helps in cpu consumption.

Other cons are:

* To make a long tap, one needs to press and release (on stock, one have just to press for long time) -EDIT- This is solved by the second version of the script, see second post.

* The responsivity of the action is not great, that's due to "input keyevent" android command

* You have to account a little battery consumption; i did my best to make the script light and i think it should be low and depends on how much you touch the screen :P

* Haptic feedback does not work

Here we go:

#!/bin/bash

#Command needed to escape chroot (comment if not running in chroot)
unchroot=/root/scripts/unchroot/unchroot.exec.sh

#Touch device
I=/dev/input/event1

#Original vertical resolution
Ymin=1920

#New size
SIZE=720x1280

#New dpi
DPI=320

#Buttons coordinates, min, max
BACK_0=150
BACK_1=250
HOME_0=500
HOME_1=600
RECENT_0=827
RECENT_1=927

#Long presso duration (1000000=1second)
LONG_PRESS_TIME=1000000

#Do not configure further

LC_ALL=C

#Function to exit cleanly
exit_function() {
echo "Quitting..."
killall evtest
$unchroot "wm size reset"
$unchroot "wm density reset"
sleep 1
$unchroot "wm density reset"
sleep 5
kill `pidof org.pocketworkstation.pckeyboard`
exit 0
}

#Restore resolution on exit
trap exit_function SIGINT SIGTERM

#Set resolution and dpi
$unchroot "wm size $SIZE"
$unchroot "wm density $DPI"
sleep 1
#Set it again to correct some glitches
$unchroot "wm density $DPI"
sleep 2
#Hacker's keyboard does not like that...
kill `pidof org.pocketworkstation.pckeyboard`

#Hacky: kill leftover evtest processes
killall evtest

#Be nice...
renice -n 19 $$

#Start main "sniffing" cycle:
evtest $I | grep 'BTN_TOUCH' -B10 --line-buffered | \
while read line; do
case $line in
*'(BTN_TOUCH), value 1'*) #Tap Down
#Store the full evtest line, it will be used later to check press time
down_line=$line
;;
*'(BTN_TOUCH), value 0'*) #Tap Up
Y=${Line_Y##* }
#Check that Y is on the Navigation bar
if [[ $Y -ge $Ymin ]] ; then
#Extract TAP UP time
split=(${line//,/ })
time_up=${split[2]}
time_up=${time_up//./}
#Extract TAP DOWN time
split=(${down_line//,/ })
time_down=${split[2]}
time_down=${time_down//./}

diff=$(($time_up-$time_down))
#Set --longpress parameter?
if [ "$diff" -ge "$LONG_PRESS_TIME" ] ; then
LP='--longpress'
#echo "long press"
else
LP=''
#echo "short press"
fi

#Check what key we pressed and emit keyevent
X=${Line_X##* }
if [ "$X" -ge $BACK_0 -a "$X" -le $BACK_1 ]; then
#echo BACK
$unchroot "input keyevent $LP KEYCODE_BACK"
elif [ "$X" -ge $HOME_0 -a "$X" -le $HOME_1 ]; then
$unchroot "input keyevent $LP KEYCODE_HOME"
#echo HOME
elif [ "$X" -ge $RECENT_0 -a "$X" -le $RECENT_1 ]; then
$unchroot "input keyevent $LP KEYCODE_APP_SWITCH"
#echo RECENT
fi
fi
;;

*'ABS_MT_POSITION_X'*) #X coordinate
#Store X position line, will extract coordinate later
Line_X=$line
;;
*'ABS_MT_POSITION_Y'*) #Y coordinate
#Store Y position line, will extract coordinate later
Line_Y=$line
;;
esac

done

if you need the unchroot command, let me know.