0
votes

Here I want to Hold Shift key and then click q and left mouse button. and then after clicking left mouse button i want to release Shift key. I also want to release Shift key whenever I click right mouse button. Code is here but it does not work:-

q::
Send {Shift Down}
Hotkey, q, toggle
Send q
Hotkey, q, toggle
   KeyWait LButton, D
        RButton::
        Hotkey, RButton, toggle
        Send {RButton}
        Hotkey, RButton, toggle
        Send {Shift Up}
        return
   KeyWait LButton
Send {Shift Up}
return
1

1 Answers

0
votes

If the Shift key is Down then the q:: does not work, you will then need to use +q::

And For Rbutton:: if the Shift key is down then Rbutton:: does not work, you will need to use +Rbutton::

[+ = Shift]

Try this code:

; [+ = Shift] [! = Alt] [^ = Ctrl] [# = Win]
#SingleInstance Force

q::
Send {Shift Down}
Hotkey, q, toggle
Send q
Hotkey, q, toggle
   KeyWait LButton, D
        RButton::
        Hotkey, RButton, toggle
        Send {RButton}
        Hotkey, RButton, toggle
        Send {Shift Up}
        return
   KeyWait LButton
Send {Shift Up}
return

+q::
Send {Shift Down}
Hotkey, q, toggle
Send q
Hotkey, q, toggle
   KeyWait LButton, D
        +RButton::
        Hotkey, RButton, toggle
        Send {RButton}
        Hotkey, RButton, toggle
        Send {Shift Up}
        return
   KeyWait LButton
Send {Shift Up}
return