Contribution: Checking for single Key press with Busybox ash

Harald Becker ralda at gmx.de
Sun Jul 14 00:37:01 UTC 2013


Hi Denys !

On 14-07-2013 00:54 Denys Vlasenko <vda.linux at googlemail.com>
wrote:

>"read -r -t2 -n1 KEY" ?
>
>The downside is that -tSECONDS -nMAXLEN are extensions,
>not a standard.

The first attached script contain the base functions of a single
key touch menu system, which can not be interrupted by Ctrl-C or
other control keys. It uses only standard commands and wait for a
single key press of either F1 to F10 or Escape (on ANSI
compatible tty). Does your read example allow for this usage?

The second script displays the base64 key token for any key you
press. End input by pressing Escape. It also shows the tokens for
control keys like Ctrl-C or Ctrl- at .

--
Harald
-------------- next part --------------
A non-text attachment was scrubbed...
Name: function_key_menu.sh
Type: application/x-shellscript
Size: 810 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20130714/d549ad98/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: key_values.sh
Type: application/x-shellscript
Size: 239 bytes
Desc: not available
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20130714/d549ad98/attachment-0001.bin>


More information about the busybox mailing list