From 3371719f208f95d15108e65fb31cc4b3bf855f5b Mon Sep 17 00:00:00 2001 From: Pierre-Hugues Husson Date: Tue, 28 Apr 2020 16:48:57 +0200 Subject: [PATCH] [Xiaomi DT2W] Call sendevent on any touchscreen On Redmi Go, there is no gesture_mask or wake_gesture, no /proc/touchpanel/wakeup_gesture, no /proc/tp_wakeup_gesture, no /proc/tp_gesture However sendevent works. FWIW it does have /proc/gesture/onoff, and /proc/gesture/data --- phh-prop-handler.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/phh-prop-handler.sh b/phh-prop-handler.sh index 0e15a1b..ba0e0b7 100644 --- a/phh-prop-handler.sh +++ b/phh-prop-handler.sh @@ -31,8 +31,13 @@ xiaomi_toggle_dt2w_event_node() { cd /sys/class/input || return echo event* ); do + isTouchscreen=false + if getevent -p /dev/input/$ev |grep -e 0035 -e 0036|wc -l |grep -q 2;then + isTouchscreen=true + fi [ ! -f "/sys/class/input/${ev}/device/device/gesture_mask" ] && - [ ! -f "/sys/class/input/${ev}/device/wake_gesture" ] && continue + [ ! -f "/sys/class/input/${ev}/device/wake_gesture" ] && + ! $isTouchscreen && continue echo "Trying to set dt2w mode with event node: /dev/input/${ev}" if [ "$1" -eq 1 ]; then # Enable