Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
March 11, 2004 Equivalent of _kbhit() in D? | ||||
---|---|---|---|---|
| ||||
What is the equivalent of _kbhit() in D for testing whether a key has been pressed? (I'm running on WinXP.) Thanks! -- Glenn Lewis |
March 11, 2004 Re: Equivalent of _kbhit() in D? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Glenn M. Lewis | Glenn M. Lewis wrote: > What is the equivalent of _kbhit() in D for testing whether a key has been pressed? > (I'm running on WinXP.) > Thanks! > -- Glenn Lewis What library is _kbhit() in? You'd probably have to find the equivalent Win32 API call and wrap it in D. See: http://www.digitalmars.com/d/windows.html and to a lesser extent: http://www.digitalmars.com/d/htomodule.html BA |
March 11, 2004 Re: Equivalent of _kbhit() in D? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Brad Anderson | Brad Anderson wrote: > Glenn M. Lewis wrote: > >> What is the equivalent of _kbhit() in D for testing whether a key has been pressed? >> (I'm running on WinXP.) >> Thanks! >> -- Glenn Lewis > > > What library is _kbhit() in? You'd probably have to find the equivalent Win32 API call and wrap it in D. > > See: > http://www.digitalmars.com/d/windows.html > > and to a lesser extent: > http://www.digitalmars.com/d/htomodule.html > > BA GetAsyncKeyState ? -- Christopher E. Miller |
March 11, 2004 Re: Equivalent of _kbhit() in D? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Glenn M. Lewis | You can call any C function from D, including all that are in the C runtime library, snn.lib: extern (C) int _kbhit(); "Glenn M. Lewis" <noSpam@noSpam.com> wrote in message news:c2qec9$i6r$1@digitaldaemon.com... > What is the equivalent of _kbhit() in D for testing whether a key has been pressed? > (I'm running on WinXP.) > Thanks! > -- Glenn Lewis |
March 11, 2004 Re: Equivalent of _kbhit() in D? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Glenn M. Lewis | For a console program try kbhit() without the _ it's defined in stdio.d S In article <c2qec9$i6r$1@digitaldaemon.com>, Glenn M. Lewis says... > >What is the equivalent of _kbhit() in D for testing whether a key has been pressed? >(I'm running on WinXP.) >Thanks! > -- Glenn Lewis |
Copyright © 1999-2021 by the D Language Foundation