On Wed, 08 Dec 2010 08:25:38 -0500, Nrgyzer <nrgy...@gmail.com> wrote:

Okay, but what function can I use to get the pressed key?
kbhit/_kbhit seems to do what I want, but hwo can I use it in D? I
always get the error, that kbhit (or similar functions) are not
available.

import std.stdio;
import std.c.stdlib;
import std.c.windows.windows;

extern(C) int kbhit(void);

void main(string[] args) {
        kbhit();
}

In order to call a C function you have to declare it. That's all std.c.windows.windows does. Just not all the functions are declared.

Plus, I saw that getch is in that header as well...

http://www.digitalmars.com/rtl/conio.html#_getch

-Steve

Reply via email to