Keydown event response time(Simple question)

ThePentiumGuy

Well-known member
Joined
May 21, 2003
Messages
1,113
Location
Boston, Massachusetts
Hey, I got a quick question.
When you hold down a key, windows automatically has a ersponse delay thing. For example open up notepad and hold down K, it pauses after the first K.
Sort of like:

K <Pause> KKKKKKKKKKKKK.

How do I avoid this in my game? This gets really annoying. I want to use as little memory as possible.

I tried GetASyncKey state (Win32 API)

Form1_KeyDown:
If getasynckeystate(keys.down) then
Y + = 1
End If

It still wont do it.

The only alternative I found was resorting to timers:

Form1_KeyDown:
If e.keycode = keys.down then
Timer1.Enabled = True
Direction = "Down"
End If

Form1_KeyUp:
If e.keycode = keys.down then
Timer1.Enabled = False
End If

Timer1_Tick:
If Direction = "Down" then
Y += 1
End If

I want to avoid using a lot of memory (ex: By using timers). Is there any way I can do this without using timers? Any quick way?

-The Pentium Guy
 
Sorry, I never got an email notifier for this post (went to junk). Heh, I did the exact same thing you were talking about before I saw this post. I just feel a little weird declaring 4 booleans..

-The Pentium Guy
 
Back
Top