ThePentiumGuy
Well-known member
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
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