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 

Gradual Arrow Press

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






PostPosted: Fri Aug 27, 2004 11:58 pm    Post subject: Gradual Arrow Press Reply with quote

I'll try to articulate this the best I can...

When playing racing games with a keyboard, the up arrow key is 9 times out of ten the accelerator pedal. The problem with this is that the key only has an on and off position. There is no in between. It's either floor the pedal, or don't even touch it.

Is there a way to make it so that when you press down on any arrow key, the longer you press, the more a racing game will respond. More specifically, I would like to have it so that when you press on the up arrow, you slowly push the accelerator pedal in until you let go of the pedal. Then, it slowly comes back..or maybe it only comes back with another button.

Any help is greatly appreciated. Thanks.
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10480

PostPosted: Sat Aug 28, 2004 12:26 am    Post subject: Reply with quote

It depends on how the game allows you to specify an acceleration level other than min or max: If the only way to do it is with a joystick or foot pedal, you're probably out of luck because AutoHotkey cannot simulate joystick movement. But if there's some way to do it with keystrokes or mouse clicks, you could probably create a hotkey to improve things.
Back to top
View user's profile Send private message Send e-mail
WhiteCloud



Joined: 19 Jun 2004
Posts: 68

PostPosted: Sat Aug 28, 2004 7:44 pm    Post subject: Reply with quote

I love these gaming related threads.

If there's no way to do what Chris said the next best thing is to do something like this:

Up::
Send {Up down}
sleep 10
Send {Up up}
sleep 10
Send {Up down}
sleep 11
Send {Up up}
sleep 9
Send {Up down}
sleep 12
Send {Up up}
sleep 8
Send {Up down}
sleep 13
Send {Up up}
sleep 7
Send {Up down}
sleep 14
Send {Up up}
sleep 6
Send {Up down}
sleep 15
Send {Up up}
sleep 5
Send {Up down}
sleep 16
Send {Up up}
sleep 4
Send {Up down}
sleep 17
Send {Up up}
sleep 3
Send {Up down}
sleep 18
Send {Up up}
sleep 2
Send {Up down}
sleep 19
Send {Up up}
sleep 1
Send {Up}
Return

I haven't tried this out. Will the 2nd to last line simulate the up key being held down until the up key is phyically released? I'm not sure how to go about that part. The rest of the code would need some tweaking of the sleep times since I think I've read that Windows has a higher minimum of value for those.
_________________
AHK = Hella fun
Back to top
View user's profile Send private message
BoBo
Guest





PostPosted: Sat Aug 28, 2004 8:46 pm    Post subject: Reply with quote

Maybe you can shrink the code using a loop and something like this

Code:
   S1 +=
   S2 -=
   sleep %S1%
   Send {Up down}
   sleep %S2%
   Send {Up up}
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