|
-
Oct 11th, 2012, 10:02 AM
#9
Re: Detecting keyboard input?
i forgot to mention that getasynckeystate will oddly enough also detect mouse clicks because values 1 and 2 are the left and right mouse buttons. Since all you are doing is counting you could simply call every key in a for next loop (1 to 128) in place of the keys.L in the sample. Every one you get a true value back on is going to increment your number. However there is also a way to detect if the key is pinned down or held down. There's a flag in the return value that not only says if it is pressed or up but if it's been pressed since the last time you checked. I suggest you study up on the api call so you don't end up counting the same keypress multiple times.
Last edited by Lord Orwell; Oct 11th, 2012 at 10:09 AM.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|