I am trying to grab keypresses from the console using Nim and am having no luck finding a way to do so. For my purposes it only needs to work for Linux. In other languages I have used things like readkey and console.readkey(), but have been unable to locate anything remotely similar for Nim in the guide, tutorials or forums. Any help is greatly appreciated :)
It's a bit complicated since there was no wrapper for termios. I think this should go into the standard library as it's something people want to do a lot: https://gist.github.com/def-/58c3374c23f120e31872