[Toybox] Would you consider adding showkey...but
Isaac Dunham
idunham at lavabit.com
Wed May 15 14:29:25 PDT 2013
On Wed, 15 May 2013 11:32:28 -0500
Rob Landley <rob at landley.net> wrote:
> On 05/14/2013 08:04:33 PM, scsijon wrote:
> > Would you consider adding the busybox showkey, but with a user set
> > time
> > including 0 for immediate, rather than the default 10 seconds?
>
> Um, details?
>
> I don't think I've ever used busybox showkey, but I'm happy to look
> at patch submissions. (I may be a little overwhelmed with _dealing_
> with them, but I'm working as fast as I can. Still chewing on
> ifconfig when I have time, and then mount's queued up right after
> that...)
>
> Let's see, fire it up in an xterm and see what it does:
>
> landley at driftwood:~$ ./busybox-x86_64 showkey
> showkey: KDGKBMODE: Invalid argument
> landley at driftwood:~$
>
> And it left my terminal in raw mode. Very nice. My static busybox
> lying around is 1.19.0, maybe they've fixed this since then? Git log
> on showkey.c says last touched in 2011, so I'm guessing no. Maybe it
> doesn't like xfce's terminal program? Dunno...
showkey is intended to be used from a VT, not X.
It reads a keypress (apparently from /dev/console), then prints its
keycode/scancode.
One implementation is esr's showkey, http://catb.org/~esr/showkey/
(which is MIT license, weighing in at 127 lines including whitespace
and comments).
There is also a (1993?!) GPL2+ Debian variant that corresponds to what
busybox has.
Also, timeout=0 may be tricky if you need to wait some time for a
keypress...
> > We wish to add the ability of checking a <ctrl>, <alt>, etc. key
> > in the init
> > and control the response depending on the keycode for function,
> > rather than
> > expect them to wait 10 seconds each time.
>
> Send me a patch?
1368653365.0
More information about the Toybox
mailing list