read from tty???
This commit is contained in:
parent
583bb76196
commit
4d77d39fc2
10
deck.sh
10
deck.sh
@ -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…
x
Reference in New Issue
Block a user