Re: mediumraw keyboard mode?

Guest section DW (
Sat, 5 Dec 1998 12:31:59 +0100 (MET)

From: Frank da Cruz <>

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.

There is some documentation:

MEDIUMRAW is mentioned in kbd_mode(1) and console_ioctl[s](4).

The Keyboard FAQ has a little information.
It is found in kbd-0.95.tar.gz and many places on the web.
For example, a (slightly outdated) version is found at .

Long ago I wrote some text for the Linux Journal; the source
for this paper still exists as .
This has some more detailed info.

You are not the first to want this - people have written a kbd
library to do just this kind of thing. Someone will be able to
give you a URL.

On the other hand, MEDIUMRAW is a rather primitive interface,
and the details of this interface may well change over time.
(This interface allows for at most 127 different keys,
and this is perhaps not enough in all cases.)

Have you considered using ncurses instead?


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