40 #if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__)))
42 # include <visp3/io/vpKeyboard.h>
86 struct timeval tv = { 0, 0 };
90 FD_SET(STDIN_FILENO, &readfds);
92 return select(STDIN_FILENO + 1, &readfds, NULL, NULL, &tv) == 1;
123 vpKeyboard::setRawMode(
bool active)
127 tcgetattr(STDIN_FILENO, &initial_settings);
129 new_settings = initial_settings;
131 new_settings = initial_settings;
132 new_settings.c_lflag &= (
unsigned int)~ICANON;
133 new_settings.c_lflag &= (
unsigned int)~ECHO;
134 new_settings.c_lflag &= (
unsigned int)~ISIG;
137 new_settings.c_oflag &= (
unsigned int)~TAB0;
139 new_settings.c_cc[VMIN] = 1;
140 new_settings.c_cc[VTIME] = 0;
141 tcsetattr(STDIN_FILENO, TCSANOW, &new_settings);
145 tcsetattr(STDIN_FILENO, TCSANOW, &initial_settings);
149 #endif // defined UNIX