I need a script that will hold w if I hold the space bar but send the r key and the down arrow if I just tap the space
I need a script that will hold w if I hold the space bar but send the r key and the down arrow if I just tap the space
Hey guys, I have no skill in script writing and I need a script that will hold w if I hold the space bar but send the r key and the down arrow if I just tap the space bar...Is that even possible? Thanks in advance.
Re: I need a script that will hold w if I hold the space bar but send the r key and the down arrow if I just tap the spa
What you're asking for is tricky for a novice, but can be done. All of the commands below should have hyperlinks for you in the codebox. You can check out the keylist too. Oh, and I use an operator (!) too. Oh, and blocks can be a good thing to read about too.
I added the Escape key hotkey to close the script just because this does overwrite the space function in every program.
If you want the space hotkey to work only in a certain program, check out #IfWinActive
Code: Select all
space::
KeyWait, space, T0.5 ; waits half a second for you to release it
If !ErrorLevel ; the ! means "NOT". There was no error - you released it quickly
Send r{down}
else ; else you were still holding it down
{
Send {w down}
KeyWait, space ; waits indefinitely for you to release the key
Send {w up}
}
return
Esc::ExitApp
If you want the space hotkey to work only in a certain program, check out #IfWinActive
Re: I need a script that will hold w if I hold the space bar but send the r key and the down arrow if I just tap the spa
I'm not sure why but while in Windows this works perfectly, in the actual program only the holding down w is working..Exaskryz wrote:What you're asking for is tricky for a novice, but can be done. All of the commands below should have hyperlinks for you in the codebox. You can check out the keylist too. Oh, and I use an operator (!) too. Oh, and blocks can be a good thing to read about too.
I added the Escape key hotkey to close the script just because this does overwrite the space function in every program.Code: Select all
space:: KeyWait, space, T0.5 ; waits half a second for you to release it If !ErrorLevel ; the ! means "NOT". There was no error - you released it quickly Send r{down} else ; else you were still holding it down { Send {w down} KeyWait, space ; waits indefinitely for you to release the key Send {w up} } return Esc::ExitApp
If you want the space hotkey to work only in a certain program, check out #IfWinActive
Re: I need a script that will hold w if I hold the space bar but send the r key and the down arrow if I just tap the spa
It could be that you need the keys to be held down longer. So try this change:
Additionally, you can check out a thread for game troubleshooting. (Note: This is from the old forums) http://www.autohotkey.com/board/topic/1 ... he-basics/
Code: Select all
; ...
If !ErrorLevel
{
Send {r down}{down down}
Sleep 400 ; make this shorter as you see fit
Send {r up}{down up}
}
else
; ...
Re: I need a script that will hold w if I hold the space bar but send the r key and the down arrow if I just tap the spa
That seems to have fixed it! Huge, huge thanks for your help!Exaskryz wrote:It could be that you need the keys to be held down longer. So try this change:
Additionally, you can check out a thread for game troubleshooting. (Note: This is from the old forums) http://www.autohotkey.com/board/topic/1 ... he-basics/Code: Select all
; ... If !ErrorLevel { Send {r down}{down down} Sleep 400 ; make this shorter as you see fit Send {r up}{down up} } else ; ...
Who is online
Users browsing this forum: Google [Bot], joefiesta and 291 guests