News:

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

passive inkey ?

Started by dedndave, May 22, 2009, 11:39:32 PM

Previous topic - Next topic

dedndave

which macro function do i grab if i want to test the keyboard
buffer for a character, but continue if the buffer is empty ?
i just want to poll the keyboard to see if a key has been pressed


EDIT - got it

i used crt__kbhit

hutch--

Dave,

That one works fine but there is an alternative if you could be bothered playing with it, the API GetAsynchKeyState() and a few others like it can also be useful.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

dedndave

Thank you Hutch
i prefer not you use the crt library if possible
i will look into that one
i tried playing with a couple API's, but had no luck
(GetLastInputInfo looked promising)

Jimg

If it's a console app, you can use peekconsoleinput

dedndave

Thanks Jim
that one looks pretty complicated for a simple poll - lol
(a lot of parameters)
but i like it - it will get rid of the crt call