Answer the question
In order to leave comments, you need to log in
Golang: how to organize keyboard control?
I am writing a console game a la roguelike, it is necessary to implement keyboard control. In C++ I used lncurses for this purpose. If something similar for th? To listen to keyboard input in an endless loop and perform some action based on the key pressed.
Answer the question
In order to leave comments, you need to log in
There is a library, look at the game examples
https://github.com/nsf/termbox-go/blob/master/READ...
Or here is another library, here is an example with moving through the list:
https://github.com/gizak /termui/blob/master/_examp...
And of course you can peep how it is implemented in these libraries and write your own implementation.
maybe it's better to join the finished project?
https://github.com//anaseto/boohu/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question