Alright, i'm using virtual keys and GetAsyncKeyState to make a sort of keyboard selectable menu system for a real basic console app i'm working on. Problem being that i've got a splash screen at the begining that prompts the user to hit enter...so now I need to know how to reset the virtual keys because once the actuall menu opens it's already made a selection (selections are made with the enter key). Here's the code (a lot of it's from this sites FAQ):
Code:
///////////////////////
int KeyDetect()
///////////////////////
{
short esc = 0;
while ( !esc )
{
esc = GetAsyncKeyState ( VK_ESCAPE );
if (GetAsyncKeyState ( VK_UP ) & SHRT_MAX)
{
if(CursorY > 5)
{
PrevCursorX = CursorX;
PrevCursorY = CursorY;
CursorY = CursorY - 1;
DrawAsterix(CursorX, CursorY);
DrawBlack(PrevCursorX, PrevCursorY);
ReturnCursor(0,16);
}
}
else if (GetAsyncKeyState ( VK_DOWN ) & SHRT_MAX)
{
if(CursorY < 13)
{
PrevCursorX = CursorX;
PrevCursorY = CursorY;
CursorY = CursorY + 1;
DrawAsterix(CursorX, CursorY);
DrawBlack(PrevCursorX, PrevCursorY);
ReturnCursor(0,16);
}
}
if (GetAsyncKeyState (VK_RETURN) & SHRT_MAX)
{
cout <<"YESS!!!";
}
}
Any and all help is appriciated!