Hi, I'm looking for a function which will return the value of the key pressed ....
I tried using GetKeyState, and other functions like that, but they depend upon the programmer knowing which key is to be pressed.
getch(); is an obvious choice, but it's not a good one because of it depends on a key being pressed, but I want the possibility of one not being pressed:-
Code:
start time = current time
while ( some parameters )
{
if ( key pressed )
{
start time = current time
variable = button pressed
}
else if ( time between start time and this time > 5 seconds )
{
print something
}
}
this is the most sudo code It think I've ever seen, never mind written, but it gets about what I want to do. I tried using getch() in the first if statement, but it didn't work . bah!!!
I researched and found WM_KEYDOWN/UP, but they have been somewhat more problematic for my code than I'd have liked - in that I don't have a clue how to use them. bah!