News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Check keypress

Started by Neil, July 12, 2010, 10:19:57 AM

Previous topic - Next topic

Neil

Is there a function that checks if any key has been pressed, & if not doesn't wait but carries on with code something like GetAsyncKeyState but without checking for a particular key?

dedndave

MS VC runtime library has "crt__kbhit"
if you look at the masm32 wait_key.asm file, you'll see it in use

Neil

Thanks Dave, that looks promising  :U. It must do something like checking the 'Head' & 'Tail' pointers in the keyboard buffer as you could in DOS

Neil

I've put a bit of code together & it does exactly what I want, brilliant  :bg

dedndave

you can get away from the crt if you want by using PeekConsoleInput and ReadConsoleInput
but it is a bit of a bag of worms   :P

Neil

Yes, I'll stick with what I know works.