| View previous topic :: View next topic |
| Author |
Message |
Homeskool
Joined: 29 Feb 2008 Posts: 2
|
Posted: Wed May 14, 2008 8:31 am Post subject: remove keypause in windows |
|
|
Hey everyone, I make little basic computer games like Pong ECT. just a hobbiest programer. I do often use autohotkey to trigger events my programs cannot. Works very well. One thing my program cannot do it change certain aspects of windows. One of those aspects is the keyboard repeat rate. IE, when you press "a" it shows an "a", and after 0.2 seconds or whatever it then starts to repeat "A". Useing the arrow keys to control my pong pattle is very silly currently because it moves a little bit, pauses, then repeats, just like if you were to press any keystroke. Does anyone know a basic script that would disable that pause all together and go right to repeating the action? Any help would be greatly apreciated!
Thanks!
Tom  |
|
| Back to top |
|
 |
Zippo() Guest
|
Posted: Wed May 14, 2008 8:54 am Post subject: |
|
|
| In your program, instead of waiting on WM_KEYDOWN messages, poll the Windows function GetKeyState() every trip through your main message loop. |
|
| Back to top |
|
 |
Zippo() Guest
|
Posted: Wed May 14, 2008 8:54 am Post subject: |
|
|
| In your program, instead of waiting on WM_KEYDOWN messages, poll the Windows function GetKeyState() every trip through your main message loop. |
|
| Back to top |
|
 |
Zippo() Guest
|
Posted: Wed May 14, 2008 9:06 am Post subject: |
|
|
Bah sorry about the double post.
Anyhow, I should have added to use PeekMessage() instead of GetMessage(). |
|
| Back to top |
|
 |
Homeskool
Joined: 29 Feb 2008 Posts: 2
|
Posted: Fri May 16, 2008 6:18 pm Post subject: |
|
|
| Wm_keydown is'nt an option in my utility. Thats why I was trying to use autohotkey to make an exe to temp disable the pause inbetween key presses. I would simply call apon this script when my app starts and have it be self terminating when my app is closed. Has anyone fooled around with this before? |
|
| Back to top |
|
 |
Zippo() Guest
|
Posted: Sat May 17, 2008 3:06 pm Post subject: |
|
|
| Homeskool wrote: | | Wm_keydown is'nt an option in my utility. |
Geeze what language can you program a game in but can't interact with the message loop or poll a key state?
Anyhow, if you have to use AHK, just:
| Code: | Loop
{
If GetKeyState("Up","p")
Send, {Up}
If GetKeyState("Down","p")
Send, {Down}
If GetKeyState("Left","p")
Send, {Left}
If GetKeyState("Right","p")
Send, {Right}
Sleep, 0
}
Up::Return
Down::Return
Left::Return
Right::Return |
|
|
| Back to top |
|
 |
|