read from tty???

master
amelia 9 months ago
parent 583bb76196
commit 4d77d39fc2

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

Loading…
Cancel
Save