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

Re: one user space progamming problem

weiyun lv napisał(a):
one keyboard input problem:

my user space program wants to do two things:
E1. read data from one fifo and display it;
E2. Check if there is input from keyboard, if there is then handle it, otherwise do nothing.

E1 should always be in execution, while E2 is event driven (when I input something it should be capable of detecting and handling.)

how to implement this with C language? Is there any C lib function which checks if there is input from keyboard or not?

If you want to simply check stdin, use select or poll. If U want to use other libraries to handle terminal (ncurses? slang?), U'll have to check it's docs to find apropriate functions.

Reply to: