Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: How can I capture keyboard input... ?

  1. #11

    How can I capture keyboard input... ?

    Actually that's the first thing I mentioned:

    I guess you could do it the quick and easy way and use virtual key codes and keypress events, but...
    However, like TheLion stated, and why I said it was wiser to capture the entire keyboard state at once, was the fact that the keypress events are bound to a form and generally do not handle multiple simultanious keypesses all that well. Capturing the keyboard state will work even if no Tform is present (done from scratch, or as a console app) and generally allows you greater control over your game input.
    My DGDev forum pascal syntax highlight settings:
    <br />[background=#FFFFFF][comment=#8080FF][normal=#000080]
    <br />[number=#C00000][reserved=#000000][string=#00C000]

  2. #12

    How can I capture keyboard input... ?

    OnKeyDown can lead to very inconsistent movement (speeding up/slowing down depending on events passed in, different keyboard repeat rates, etc.). Not recommended, dude. Use GetKeyState, GetAsyncKeyState or GetKeyboardState instead.
    "All paid jobs absorb and degrade the mind."
    <br />-- Aristotle

Page 2 of 2 FirstFirst 12

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
  •