how to check for the enter key pressed using GetCh()

Im creating a little program that involes a menu i created(just a console application). I want to be able to read in when the user uses the enter key, currently i only have the s key used, which represents the Down key. If i use a switch statement for the char, what is the ascii code that allows me to find the enter key?
This line of code im trying to create will end up replacing the "true" statement i wrote in as the while loop condition. Thanks for the help!
1
2
3
4
5
6
7
8
9
10
switch(c)
        {
            case 's':
                Position++;
                if(Position == 5){Position = 1;}
                FindCursor(Position,Pos);
                SetCursor(Pos);
                RefreshMenu(Obj);
        }
        }while(true);
Last edited on
well when the user hits enter the character put into the buffer is '\n' so all you need to do is pick that up.
I've already tried that ui uiho, it does not seem to work. The exact code i wrote was:
 
}while(c != '\n');

which does not work :/, any other suggestions?
Topic archived. No new replies allowed.