http://www.autohotkey.com/board/topic/1 ... ouch-help/
The Code:
Code: Select all
~LCtrl up:: ;use LCtrl "up" so it doesn't get triggered when you hold ctrl
Goto, Crouch
Crouch:
; Changed: Trigger was changed to "~LCtrl" 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, {LCtrl down} ; Initiate 'Crouch'
If IsKeyPressed("LCtrl") ; Check if 'LCtrl' pressed. If pressed & released, Break loop.
Send, {LCtrl 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
}Normal crouch is still working as intended
Double-tapping LCtrl causes you to toggle crouch, tap crouch again to get out of toggle-crouch
How to install it:
- Download AutoHotkey
- Create a new Autohotkey script (Right-click, New>Autohotkey Script)
- Copy and paste the script from this post, and save the document
- Alternatively, you can download the file from this link https://www.dropbox.com/s/bdgfp8tdyd2pm ... ch%201.ahk
- Run the script by double-clicking on the file, or right-click>run
- If you use a different key for crouching in Battlefield 2, make sure to change it back to Lctrl, or edit the script to fit your needs
- You can turn pause the script by right clicking the Autohotkey icon in the taskbar, then selecting "Pause Script"







