I knwo how to use gotoxy(x, y) but how do I detect an arrow key using console?
I knwo how to use gotoxy(x, y) but how do I detect an arrow key using console?
Hopefully that will work, if not, reply. It works for me, I'm using DJGPP BTW.Code:#define leftarrow 'K' #define uparrow 'H' #define downarrow 'P' #define rightarrow 'M' getch(); if (getch()==leftarrow) { ... ... }
That didn't work. I am using Bloodshed Dev-C++ 4/4.01 compiler.
Website(s): http://www16.brinkster.com/trifaze/
E-mail: [email protected]
---------------------------------
C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
DirectX Version: 9.0b
DX SDK: DirectX 8.1 SDK
For the gotoxy() in a console;
FAQ - Various
For the <- and -> keys, I guess you would need to somehow read WM_KEYUP messages and respond to VK_LEFT and VK_RIGHT, but in a console this would not be easy........ If you want edited input in your program I guess you would be better off with an editbox in a Win32 Application.
Out of interest, what are you trying to do