AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

remove keypause in windows

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Homeskool



Joined: 29 Feb 2008
Posts: 2

PostPosted: Wed May 14, 2008 8:31 am    Post subject: remove keypause in windows Reply with quote

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 Smile
Back to top
View user's profile Send private message MSN Messenger
Zippo()
Guest





PostPosted: Wed May 14, 2008 8:54 am    Post subject: Reply with quote

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





PostPosted: Wed May 14, 2008 8:54 am    Post subject: Reply with quote

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





PostPosted: Wed May 14, 2008 9:06 am    Post subject: Reply with quote

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

PostPosted: Fri May 16, 2008 6:18 pm    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
Zippo()
Guest





PostPosted: Sat May 17, 2008 3:06 pm    Post subject: Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group