How to simulate Window's "Press any key to continue..."

Mike Parker aldacron at gmail.com
Fri Nov 22 04:45:21 UTC 2019


On Friday, 22 November 2019 at 04:22:07 UTC, FireController#1847 
wrote:

> Right, but readln will only wait until the user presses the 
> delimiter (by default Enter/Return). I want it to wait until 
> ANY key is pressed, not a specific key

The documentation for std.stdio.File shows two functions for 
reading input: readln and readf. If readln isn't what you want, 
then readf probably is:

https://dlang.org/phobos/std_stdio.html#.File.readf

Also, there's a freely available book online to help get you up 
to speed: Programming in D. Here's the section on reading from 
stdin with readf:

http://ddili.org/ders/d.en/input.html


More information about the Digitalmars-d-learn mailing list