If I have a thread that reads from /dev/con1
waiting for
char buf[80];
int fd1 = open( “/dev/con1”, O_RDWR );
for(; {
int sz = read( fd1, buf, 1 );
printf( “%d, %c”, sz, buf[0] );
}
This will never work, it simply stall everything
if I do a select(), I can’t read chars unless I push return
for instance, I won’t get anything like an kbhit() statement.
I look through termios stuff,
but I can’t figure out a way of reading chars
without pressing return.
How can I do it, to have something like QUAKE/DOOM behavior.
Upon a key unblock, read and do something in CONSOLE mode.
I know it’s possible to program Controls keys without termios,
at least it seems to be, but how do I get something like Doom ?
= void fire()
= strafe_right()
= go_left()
etc.
I mean in Doom, you don’t press enter, enter, etc.
It wouldn’t make sense, right?
I tried:
readcond( fd, buf, 80, 0, 0, 0 );
didn’t work
Anybody has an idea or trick ???
Thank you very much,
Fred.