Hello,
I played with this simple program, which just sets the raw mode for
the console and writes back written characters:
--------------------------
#include <u.h>
#include <libc.h>
void
main (int argc, char *argv[])
{
int cfd;
char buf[2];
int nr;
cfd = open("/dev/consctl", OWRITE);
write(cfd, "rawon", 5);
while((nr = read(0, buf, 1)) > 0) {
if(buf[0] == 'q') break;
buf[1] = 0;
print("%s", buf);
}
close(cfd);
exits(nil);
}
--------------------------
But I was surprised it doesn't do what I want.
The rio(1) man page says, in the 'Raw text windows' section that
'... no typed keyboard characters are special, ... and all are passed
to a program immediately upon reading'.
However, it seems rio still interprets ^u, ^a, ^e, ^w, BS, arrows,
page up/down,... (although not DEL, e.g.)
Can anybody explain to me what is wrong?
(Also I don't quite understand why pressing ^d results in drawing EOT,
pressing F1 does nothing as well as pressing alt-whatever [e.g.
alt-AE]...; Also, what must I do to see the codes (like ^a=0x01)
instead of the characters?)
Thanks a lot!
Ruda