0
How to get specific key input from user?
I was wondering how to get specific key input("enter" for example), so the user can only press that key to use a specific function.
2 odpowiedzi
+ 4
Something like this?
char input = (char)Console.Read();
or maybe:
char input = Console.ReadKey().KeyChar;
Then:
if(input == 'w')
moveUp();
else if(input == 'd')
moveRight();
0
Ok I'll try that thanks.