36 static int initialized;
44 if(tcgetattr(STDIN_FILENO, &term_attribs) < 0)
46 perror(
"tcgetattr: ");
58 term_attribs.c_lflag &= ~(ECHO | ICANON | ISIG | IEXTEN);
59 term_attribs.c_iflag &= ~(IXON | BRKINT | INPCK | ICRNL | ISTRIP);
60 term_attribs.c_cflag &= ~(CSIZE | PARENB);
61 term_attribs.c_cflag |= CS8;
62 term_attribs.c_cc[VTIME] = 0;
63 term_attribs.c_cc[VMIN] = 0;
65 if(tcsetattr(STDIN_FILENO, TCSANOW, &term_attribs) < 0)
67 perror(
"tcsetattr: ");
75 FD_SET(STDIN_FILENO, &rfds);
76 memset(&tv, 0,
sizeof(tv));
78 retcode = select(1, &rfds, NULL, NULL, &tv);
79 if(retcode == -1 && errno == EINTR)
88 else if(FD_ISSET(STDIN_FILENO, &rfds))
102 FD_SET(STDIN_FILENO, &rfds);
104 retcode = select(1, &rfds, NULL, NULL, NULL);
105 if(retcode == -1 && errno == EINTR)
int getch()
gets character from keyboard input
My version of conio.h include file that some portions of code provided by SensAble require...
int _kbhit()
waits for user input on keyboard
static struct termios term_attribs term_attribs_old
static void restore_term(void)