AutoHotkey Community

It is currently May 27th, 2012, 12:12 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Gradual Arrow Press
PostPosted: August 28th, 2004, 12:58 am 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: August 28th, 2004, 1:26 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 28th, 2004, 8:44 pm 
Offline

Joined: June 19th, 2004, 9:02 pm
Posts: 68
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 28th, 2004, 9:46 pm 
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}


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher and 15 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group