Thread overview
Equivalent of _kbhit() in D?
Mar 11, 2004
Glenn M. Lewis
Mar 11, 2004
Brad Anderson
Mar 11, 2004
Vathix
Mar 11, 2004
Walter
Mar 11, 2004
StuartD
March 11, 2004
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
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
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
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
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