mediumraw keyboard mode?

Frank da Cruz (
Fri, 4 Dec 1998 11:17:41 -0500 (EST)

In the quest to win the hearts and minds of the PC-using public, Linux
and other forms of UNIX suffer from certain limitations that tend to put
people off right away. One of the most obvious is that keys often don't
do what their labels say they do. This is because applications don't
have a reasonable form of access to the keyboard.

Let us consider only the case where the user is using the actual keyboard
of the PC, and not coming into the PC via Telnet, rlogin, getty, etc.

The normal level of reading keystrokes is read(0,&c,1), but this does not
let us see the F-keys, arrow keys, editing keys, etc, nor distinguish the
numeric keypad digits from the top-rank digits. (Well, it lets us "see"
these keys, but only through the keymap, in which a single key press might
emit in a string of several characters.) The point is, the application
has no way of knowing the user pressed (say) the F7 key, Alt-x, Shift-Insert,
Ctrl-Page-Up, etc.

I understand it is possible to put the keyboard in "raw" mode and sense
key up/down events and scan codes, but I think this interface is way too
difficult (and dangerous) to expect the average application developer to
cope with. Plus it doesn't work on xterms.

What is needed is an API to read keycodes, similar to read(), but which
returns a unique code for each key and key combination, and does so both
for the console and xterms, and yet returns a sensible error when attempted
from a remote terminal.

I heard a rumor that such a "mediumraw" API exists but is not documented.
If so, I'd like to find out about it and use it to add a "friendlier"
and more intuitive user interface to the Linux version of C-Kermit, and,
in the process, maybe write the needed documentation.

Can somebody tell me where to start looking?


Frank da Cruz
The Kermit Project
Columbia University

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at