On Tuesday, 15 July 2014 at 02:49:56 UTC, WhatMeWorry wrote:
Is there a way to continue with any old key press? or just the enter key?

Yeah. It is more complex than you'd think but my terminal library can do it:

https://github.com/adamdruppe/arsd/blob/master/terminal.d

Example usage:

import terminal;

void main() {
  auto terminal = Terminal(ConsoleOutputType.linear);

  // gives real time input capability
auto input = RealTimeConsoleInput(&terminal, ConsoleInputFlags.raw);

  // write to them
  terminal.writeln("Press any key to exit");

  // get a single key
  auto ch = input.getch();
  terminal.writeln("Bye!");
}


PS this is also described in my book http://www.packtpub.com/discover-advantages-of-programming-in-d-cookbook/book

Reply via email to