Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: VDR developer version 1.1.11



On Mon, 2002-09-30 at 11:00, Klaus Schmidinger wrote:

> The reason why I still have '#ifdef's around the implementation of
> the KBD stuff is because it uses the getch() function of 'ncurses'.
> I didn't find another way of reading a single character from stdin
> without blocking, and I didn't want to force everybody to have

#include <termios.h>

        struct termios tm;

        if (!tcgetattr(0, &tm)) {
                tm.c_iflag = 0;
                tm.c_cc[VMIN] = 0;
                tm.c_cc[VTIME] = 0;
                tcsetattr(0, TCSANOW, &tm);
        }
        fcntl(0, F_SETFL, fcntl(0, F_GETFL, 0) | O_NONBLOCK);

Afterwards, you can read characters with read(0, &ch, 1).

Or did I misunderstand the problem?

Thomas



-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index