- 1
How do I get raw input from console application?
I'm trying to creat silly console application game there character is moved in printed grid. He suppose to move up, down, left and right. I' want to be able to adjust it's position by inputing certain character in console, but without pressing Enter each time I have to make a move. How do I make this happen? What kind of Console.(smth) command should I use? Then I type "Console." it shows available opptions, but explanations arren't clear to me. Also, how can I find this kind of information on my own? Any websites or references would help. I tried searching here https://msdn.microsoft.com/en-us/library/system.console(v=vs.110).aspx , but it is too hard for me to understand :D.
3 Réponses
+ 2
This little code would return the pressed keys.
https://code.sololearn.com/cY4DIkUndtQ8/?ref=app
+ 1
There's a problem with this code though, it only works with arrow keys and special keys. Not with letters.