How do I get raw input from console application? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
- 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.

10th Nov 2017, 8:54 PM
Jacob “uhgfel” L
Jacob “uhgfel” L - avatar
2 ответов
+ 2
This little code would return the pressed keys. https://code.sololearn.com/cY4DIkUndtQ8/?ref=app
10th Nov 2017, 9:06 PM
Private [GER]
Private [GER] - avatar
+ 1
There's a problem with this code though, it only works with arrow keys and special keys. Not with letters.
10th Nov 2017, 9:28 PM
Private [GER]
Private [GER] - avatar