(I originally posted this on the Beginners board, but wasn't getting any replies there, so this is a repost)
Say I use getch(), and the person enters the up, down, left, or right key. How would I compare the variable (Let's say the variable is called 'Var') to see if it was one of those keys in an if statement?
I had already tried the cout test, and it would just give an identical unicode-looking character for each one. I'll check out the sites though, thanks!
And yeah, I understand it's terrible for games. It's just that I was working on this a while back, and rediscovering it, really wanted to complete it. Also, I have a problem still. Comparing as
if(Var == 56){}
doesn't work, and neither does VK_UP. I think I am just being extremely ignorant.
I had already tried the cout test, and it would just give an identical unicode-looking character for each one
cast it to int. 0x26 = .38
Edit:
doesn't work, and neither does VK_UP
weird. Check if there is an equivalent to keypad or something that needs to be configured.
Post the code, and please be patient
Edit2: from the hamsterman's link:
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.