Garbledygook wrote:
Sure, have another section that simply sends the normal key up/down on the other key:
Code:
~*X::
Send, {<crouch_key>}
return
[/code]
You mean like this?
Code:
~LAlt up:: ;use LAlt "up" so it doesn't get triggered when you hold ctrl
Goto, Crouch
Crouch:
; Changed: Trigger was changed to "~LAlt" as ~ allows normal operation of key.
If (a_tickCount-lasttime < 400) ;Check when we released ctrl the last time if < 400ms initiate Crouch
{
Loop
{
Send, {LAlt down} ; Initiate 'Crouch'
If IsKeyPressed("LAlt") ; Check if 'LAlt' pressed. If pressed & released, Break loop.
Send, {LAlt up} ; Release 'Crouch'
Break
}
}
lasttime:=a_tickCount
Return
IsKeyPressed(v_KeyName)
; Returns 1 if %v_KeyName% is currently being pressed, otherwise 0
{
GetKeyState, state, %v_KeyName%, P
If state = D ; The key has been pressed
{
Return 1
}
Return 0
}
~*X::
Send, {LCtrl}
return
Sorry for being a pain in the ass but:
Now, what I would like is one button pressing once for toggle crouch and if you press that toggle crouch again you stand up. Then if you are in toggle crouch and press the normal crouch button (not toggle) you also stand up. The the normal crouch button should disable the toggle crouch button.
Also you don't need 2 taps for toggle crouch when you have one for normal crouch and another one for toggle crouch.
Is this what the script will do now or do I have to change it again?