On Friday, 19 November 2021 at 17:36:55 UTC, BoQsc wrote:
Let's say I want to write a simple program that asks for an
input of a single character.
After pressing a single key on a keyboard, the character is
printed out and the program should stop.
This is platform specific. About 10 lines of code for a minimum
implementation per OS, but if you don't wanna do it that way my
library has a function for it with a prepackaged sample:
http://arsd-official.dpldocs.info/arsd.terminal.html#single-key
that's arsd-official:terminal on dub or you can grab the file
from my github repo.
I guess you could view my source to see the impl but I don't feel
like pulling it out right now.