Subj : Input without Carriage Return (Enter) To : Nightfox From : Mercyful Fate Date : Thu Sep 17 2009 02:04 pm Re: Input without Carriage Return (Enter) By: Nightfox to Mercyful Fate on Wed Sep 16 2009 16:08:05 > That may work in Windows, but I believe Jon Justvig is working in Linux and > wants his door to at least work in Linux. For a multi-platform solution, th > are ways to use the appropriate function depending on which platform you're > using. Indeed, although i thought it was being asked an example of both Windows and linux. In linux i would use read() to get stright from stdio. This is just a quick and dirty example... You still need to add buffering for escape sequences etc... # include # include # include # include char getkey() { fd_set fds; timeval tv; char buffer[256]={0}; int len = 0; char ch; while(1) { if (feof(stdin) || ferror(stdin)) clearerr(stdin); FD_ZERO(&fds); FD_SET(STDIN_FILENO, &fds); tv.tv_sec = 0; tv.tv_usec = 400000; // .4 second delay / Save CPU Usage if (select(STDIN_FILENO+1, &fds, 0, 0, &tv)) { if (FD_ISSET(STDIN_FILENO, &fds)) { len = read(STDIN_FILENO, buffer, sizeof(buffer)-1); ch = buffer[0]; break; } } } return ch; } --- þ Synchronet þ Digital Distortion: digitaldistortionbbs.com .