Get single keystroke?
Sean Eskapp
eatingstaples at gmail.com
Mon Mar 21 15:00:51 PDT 2011
== Quote from Andrej Mitrovic (andrej.mitrovich at gmail.com)'s article
> On 3/21/11, Sean Eskapp <eatingstaples at gmail.com> wrote:
> > == Quote from Andrej Mitrovic (andrej.mitrovich at gmail.com)'s
article
> >> Here's something simpler:
> >> import std.stdio : writefln;
> >> extern(C) int kbhit();
> >> extern(C) int getch();
> >> void main()
> >> {
> >> while(!kbhit())
> >> {
> >> // keep polling
> >> // might use thread.sleep here.
> >> }
> >> writefln("Key hit was %s.", getch());
> >> }
> >
> > What extra linker dependencies does this add?
> >
> snn.lib
What about on Linux?
More information about the Digitalmars-d-learn
mailing list