|
From: | Julio C. Neves |
Subject: | Re: [shell-script] Como utilizar as teclas de SETA em shell ? |
Date: | Sat, 1 Aug 2015 10:13:33 -0300 |
Olá pessoal, bom dia, possuo esse script que movimenta apertando a, s, z e wpra esquerda, direita, para baixo e para cima, no entanto, queria saber como fazê-lo movimentar com as SETAS do TECLADO ( ⇦ ⇧ ⇨ ⇩ ), alguma sugestão?
tput clear;
tput civis;
Lin=$(($(tput lines) / 2))
Col=$(($(tput cols) / 2))
tput cup $Lin $Col; echo X
while true
do
read -sn 1 Chave
tput cup $Lin $((Col > 0 ? Col - 1 : 0)); echo -n " "
case $Chave in
[Aa]) ((Col > 0)) && let Col-- ;;
[Ss]) ((Col < $(tput cols))) && let Col++ ;;
[Zz]) ((Lin < $(tput lines))) && let Lin++ ;;
[Ww]) ((Lin > 0)) && let Lin-- ;;
[Qq]) tput reset; echo; exit
esac
tput ech 1
tput cup $Lin $Col
echo -n X
done( O O ) +===========oOO==(_)==OOo==============+ | | | °v° Marcos da B.M. Oliveira | | /(_)\ CEO Terminal Root | | ^ ^ www.terminalroot.com.br | +======================================+
[Prev in Thread] Current Thread [Next in Thread]
- Como utilizar as teclas de SETA em shell ?, Marcos Oliveira, 2015/08/01
- Re: [shell-script] Como utilizar as teclas de SETA em shell ?, Julio C. Neves <=
- Re: [shell-script] Como utilizar as teclas de SETA em shell ?, Marcos Oliveira, 2015/08/01
- Re: [shell-script] Como utilizar as teclas de SETA em shell ?, Julio C. Neves, 2015/08/01
- Re: [shell-script] Como utilizar as teclas de SETA em shell ?, Marcos Oliveira, 2015/08/01
- Re: [shell-script] Como utilizar as teclas de SETA em shell ?, Julio C. Neves, 2015/08/01
- Re: [shell-script] Como utilizar as teclas de SETA em shell ?, Marcos Oliveira, 2015/08/02
- Re: [shell-script] Como utilizar as teclas de SETA em shell ?, Julio C. Neves, 2015/08/02
- Re: [shell-script] Como utilizar as teclas de SETA em shell ?, Marcos Oliveira, 2015/08/02
- Prev by Date: Como utilizar as teclas de SETA em shell ?
- Next by Date: Re: [shell-script] Como utilizar as teclas de SETA em shell ?
- Previous by thread: Como utilizar as teclas de SETA em shell ?
- Next by thread: Re: [shell-script] Como utilizar as teclas de SETA em shell ?
- Index(es):