Results 1 to 10 of 10

Thread: Detecting keyboard input?

Threaded View

  1. #9
    coder. Lord Orwell's Avatar
    Join Date
    Feb 2001
    Location
    Elberfeld, IN
    Posts
    7,628

    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.
    My light show youtube page (it's made the news) www.youtube.com/@lightsofelberfeld
    Contact me on the socials www.facebook.com/lordorwell

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
  •  



Click Here to Expand Forum to Full Width