[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
This commit is contained in:
Pierre-Hugues Husson 2020-04-28 16:48:57 +02:00
parent 62dcebdd7f
commit 3371719f20

View File

@ -31,8 +31,13 @@ xiaomi_toggle_dt2w_event_node() {
cd /sys/class/input || return cd /sys/class/input || return
echo event* echo event*
); do ); 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/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}" echo "Trying to set dt2w mode with event node: /dev/input/${ev}"
if [ "$1" -eq 1 ]; then if [ "$1" -eq 1 ]; then
# Enable # Enable