Discussion:
Responding to keypress events in Turbo C
(too old to reply)
S Kinsey
2005-02-28 19:12:30 UTC
Permalink
Hello

I have written a games program on my palmtop, using C and the Palm API
functions, and want to use Turbo C to compile the program into a windows
console program. Unfortunately I can't find any suitable header files in
Turbo C for event-driven code.

Does anyone know of instructions that will do 'getch()' within a certain
time frame, for instance? Are there any instructions that will return true
if a new character has been entered on the keyboard? Do I have to use the
Windows 98 API functions, and if so which ones do I use? The Microsoft
Development Network seems to keep quiet about historical operating system
functions!

Thank you

Simon.
Bob Gonder
2005-02-28 21:08:09 UTC
Permalink
Post by S Kinsey
console program. Unfortunately I can't find any suitable header files in
Does anyone know of instructions that will do 'getch()' within a certain
time frame, for instance? Are there any instructions that will return true
if a new character has been entered on the keyboard? Do I have to use the
<conio.h>
if( kbhit() )
c = getch();
Post by S Kinsey
Windows 98 API functions, and if so which ones do I use? The Microsoft
<windows.h>
GetNumberOfConsoleInputEvents(stdin, &written);
if( 0 == written )
continue;
ReadConsoleInput(stdin, &input_record, 1, &written) )

Loading...