I have this enum for all four possible arrow key presses
enum Direction{up=ConsoleKey.UpArrow, left=Consolekey.LeftArrow,...};
private ConsoleKeyInfo userSelect;
private bool mQuit;
I then have
public void getUserInput()
{
userSelect = Console.ReadKey()
if (userSelect.Key == ConsoleKey.Escape)
{
mQuit = true;
}
else if(userSelect.Key == "check if key press is value in enumeration")
{
//implementation
}
}
Can't work out what the code would be to check "if Key press is one of the values in enum" Any ideas?