Begining with D

1100110 0b1100110 at gmail.com
Sat Oct 12 14:27:14 PDT 2013


On 10/10/2013 02:36 PM, Adam D. Ruppe wrote:
> On Thursday, 10 October 2013 at 19:19:53 UTC, Ali Çehreli wrote:
>> import std.c.linux.termios;
>
> worth noting that this is Linux only. doing it on Windows is a little
> different.
>
> Working with console/terminal input and output can get surprisingly
> complex, and doing it cross-platform is easiest with a library.
>
> Robik's consoleD is one:
> https://github.com/robik/ConsoleD/blob/master/consoled.d
>
> it focuses on enabling color and drawing mainly, and also has functions
> to turn off the line buffering and getch().
>
> If you use his library, you can do this:
>
> import consoled;
>
> void main() {
>          int a = getch(); // gets just one character
>          writecln(a); // prints back out what you got
> }
>
> and other nice things.

I had issues with getch() on ConsoleD...

If you too have issue, you can try 
github.com/D-Programming-Deimos/ncurses which has similar functions, but 
is also way more complex...


More information about the Digitalmars-d-learn mailing list