read from tty???

master
amelia 1 year ago
parent 583bb76196
commit 4d77d39fc2

@ -1,6 +1,6 @@
#!/usr/bin/env sh
set -f
set -x
#set -x
MainMenu="Install/Tools/Download/Test/Dump"
@ -236,14 +236,14 @@ drawmenu "$STARTINGMENU"
# input loop
while read -rsn1 ui; do
while read -rsn1 ui </dev/tty; do
case "$ui" in
$'\x1b') # Handle ESC sequence.
# Flush read. We account for sequences for Fx keys as
# well. 6 should suffice far more then enough.
read -rsn1 -t 0.01 tmp
read -rsn1 -t 0.01 tmp </dev/tty
if [ "$tmp" == "[" ]; then
read -rsn1 -t 0.01 tmp
read -rsn1 -t 0.01 tmp </dev/tty
case "$tmp" in
"A") menumove 1;; # up
"B") menumove -1;; # down
@ -252,7 +252,7 @@ while read -rsn1 ui; do
esac
fi
# Flush "stdin"
read -rsn5 -t 0.01
read -rsn5 -t 0.01 </dev/tty
;;
# Other one byte (char) cases. Here only quit.
q) break;;

Loading…
Cancel
Save