what should i do to make my program recognise that im hiting the ESC key of the keyboard or any other key ty
what should i do to make my program recognise that im hiting the ESC key of the keyboard or any other key ty
provide some useful information. Like compiler, operating system, etc
windows, compiler dev-c++
Which version of windows, console or windowed app?
Don't just answer my questions, think about what might be important information and give it up. But I'd search the board for how to read function keys
GetAsyncKeyState(VK_ESCAPE);
http://msdn.microsoft.com/library/de...nckeystate.asp
operating systems: mac os 10.6, debian 5.0, windows 7
editor: back to emacs because it's more awesomer!!
version control: git
website: http://0xff.ath.cx/~as/
test the return value of the keyboard input function for ESC key.
Code:const int ESC = 27; int c = cin.get(); if( c == ESC) { // do something }
not what i had in mind for me i would do this
Code:#inlcude <conio> .. int menu; menu=getch(); switch (menu) { case(27); { ... } }
Kenny is on the right track. I create a example program like this for another person recently, feel free to use it and learn from it. It uses CONIO.H. There is also a way to do this similarly with WINDOWS.H
Sent from my iPadŽ
If you wanted C code then you should have posted the question on the C board, not the C++ board.Originally Posted by kennny2004