key press
-
help me how to use key press function in C programming at DOS 16-bit environment. i mean just like: if (press Delete on keyboard) { ....process.... } thousands thanks :) >>teaching is also learning<<
-
help me how to use key press function in C programming at DOS 16-bit environment. i mean just like: if (press Delete on keyboard) { ....process.... } thousands thanks :) >>teaching is also learning<<
I found something, but I don't know if it's usefull. MSDN: _getch Requirements _getch <conio.h> Win 98, Win Me, Win NT, Win 2000, Win XP Return Value Returns the character read. There is no error return. Remarks The _getch and _getwch functions read a single character from the console without echoing. _getche and _getwche read a single character from the console and echo the character read. None of these functions can be used to read CTRL+C. When reading a function key or an arrow key, each function must be called twice; the first call returns 0 or 0xE0, and the second call returns the actual key code. That would make:
char ch; ch = _getch(); ch = _getch(); //each function has to be called twice to read function or arrow keys
Don't forget:#include <conio.h>
-
help me how to use key press function in C programming at DOS 16-bit environment. i mean just like: if (press Delete on keyboard) { ....process.... } thousands thanks :) >>teaching is also learning<<
You are programming for DOS. What is that?? ;P Just kidding. I have not worked with a complier that would produce DOS code in the last 7 years... The stuff about _getch() that Xander80 said should work in dos. John