| Scylla+Charybdis old home
| Tools (old)
| Tools (new)
Moving to GitHub, slowly
The software on this pages will slowly be moved to GitHub https://github.com/hilbix/.
The CVS repository will be migrated to GIT as well, so the history will be preserved, a bit. See FAQ.
Scylla and Charybdis, keypressed - Tools
The tools are developed under Linux with
release early, release often
So you can consider this beta software, or alpha, or pre-alpha, or even worse ;)
Have a look in the download directory for all downloads.
As always here, all you get is the source. No binaries here.
Nonblocking, nondestructible test for waiting data on TTYs, sockets and probably pipes
⇒ ⇒ ⇒ The development shifted to another location. All future versions will be published at https://github.com/hilbix/keypressed
⇐ ⇐ ⇐
- Returns 0 (true) if there is input data waiting.
- Returns 1 if no input data waiting.
- Returns 255 on errors.
- Return is undefined on unknown input types.
- Does not read or print anything.
- Does not set tty into CBREAK mode! As the tty usually is in line mode you need to press Enter for keypressed to detect the input
while ! keypressed; do ...; done
while ! keypressed </dev/tty; do ...; done
Limitations and bugs:
- The input data is not touched and stays there to be read
- Commandline is ignored for now
- Only fd0 (stdin) is checked, be sure to use poper IO redirection
- No Hangup detection
- Works only on input types which support certain ioctl() and select(), known to work on TTYs and Sockets and maybe Pipes.
- Behavior on unsupported types (files, non-tty devices, often Pipes) therefor is undefined. It depends on your OS if select() signals read (gives true) or not (gives false) or error (gives 2).
This Works is placed under the terms of the Copyright Less License,
see file COPYRIGHT.CLL. USE AT OWN RISK, ABSOLUTELY NO WARRANTY.
Actually this only is a minimum wrapper around a library call.
download (5864 bytes) sig
You can give a timeout in milliseconds
Also install path now is to /usr/local
download (5679 bytes) sig
First very simple version
License and Disclaimer
All you can see here is free software according to the GNU GPL.
Copyright (C)2000-2011 by Valentin
Note that the software comes with absolutely no warranty of any kind.
You use the software at your own risk.
Valentin Hilbig cannot be hold responsible for any unintended damage,
lost data or malfunction of the software you can find here.
Last modified: 2011-09-12 by Valentin Hilbig