Search code examples
scriptingautohotkeyahk2autohotkey-2

auto hot key v2: block of code does not execute when holding shift key


this is actually a script for my little game.. when player is running (you need hold the shift to run faster/sprint) and if you do so the script does not work...you have to release the key and then press "xButton2" to make it work...this so annoying.. can you please show me how i can modify the script so it executes the block of code there (xButton2) even if iam holding shift or not.

#SingleInstance Force

~x:: 
{
    Send "{2 down}"
    Sleep 50 ;sleep 
    Send "{2 up}"
    Sleep 50
    Send '{Alt}'
    Sleep 300
    MouseClick "Right"
    Send '{Alt}'
    return
}

; XButton2  these are some extra button with my mouse
; XButton1

~XButton2::
{
    Send "{6 down}"
    Sleep 50
    Send "{6 up}"
    Sleep 50
    MouseClick "Right"
}

Solution

  • oh boy it was piece of cake i am so noob at programming..just add * at the start of macro: *~x:: { Send "{2 down}" Sleep 50 ;sleep }