Results 1 to 6 of 6

Thread: Simple unblocked readkey.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    On Windows you can also use GetAsyncKeyState to get the state of a specific key using one of VK_[xxx] virtual codes and even detect whether the key has been pressed or not previously.

  2. #2
    I would save readKey in a variable, because it is a complicated function? No reason to call it twice.

  3. #3
    as far as i remember, readkey removes the key pressed from the buffer. if you press a special key, it will put 2 chars in the buffer: a #0 char and another char. the sequencial call to readkey will catch them. but i think this will not allow to have multiple keypress, as the buffer is very short, only 16 chars (at least in dos/windows i think). unless you manage to extend that buffer.

  4. #4
    Quote Originally Posted by User137 View Post
    I would save readKey in a variable, because it is a complicated function? No reason to call it twice.
    It's called a second time to catch the scancode.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •