Page 1 of 1

Help with this code pls

Posted: 25 May 2022, 04:15
by loadness
Hi, i have this code to send a series of keys on press and wait for right click. what i want is to wait for two keys at the same time, right click and left click to trigger the macro. how could i modify it to do that?

Code: Select all

#IfWinActive GTA:SA:MP
#SingleInstance, Force
#InstallMouseHook
#InstallKeybdHook
SetBatchLines -1

~$*RButton::

Loop
{
GetKeyState, RMB, RButton
If RMB=D
{
Keywait, Rbutton
sleep 50
Send, {Wheeldown}
sleep 50
Send, {c down}
sleep 5
Send, {c up}
sleep 5
Send, {Wheelup}
sleep 50
Send, {Wheeldown}
Sleep 50
}
}

#IfWinActive
F2::Pause

Re: Help with this code pls

Posted: 25 May 2022, 05:16
by mikeyww
Welcome to this AutoHotkey forum!

Press RButton first.

Code: Select all

RButton::RButton
RButton & LButton::
While GetKeyState("RButton", "P") & GetKeyState("LButton", "P") {
 Send x
 Send y
}
Return
Explained: Custom combinations