mouse_button_left := "1" additional button

Ask gaming related questions (AHK v1.1 and older)
rainrain
Posts: 45
Joined: 20 Jan 2022, 00:17

mouse_button_left := "1" additional button

Post by rainrain » 05 Jun 2023, 10:39

how can I set mouse_button left to press 2 key, "1" and rbutton?
tried 1{rbutton} and mouse_button_left but it didn't work

Code: Select all

mouse_button_left := "1"
mouse_button_right := "f1"



#If WinActive(GMWI)                                          ;IfWinActive Gw2-64.exe



LButton::
sendinput {rbutton}
  if GetKeyState("RButton","P") and !Action_Camera_RMB
    allow_key("LButton","down")
  else if Check_Cursor(active_cursor) = 0 {
    allow_key(mouse_button_left,"down")
    Action_Camera_LMB := true
  }
  else
    allow_key("LButton","down")
return

LButton up::
sendinput {rbutton up}
  if Action_Camera_LMB {
    allow_key(mouse_button_left,"up")
    Action_Camera_LMB := false
  }
  else
    allow_key("LButton","up")
return
Last edited by gregster on 05 Jun 2023, 10:41, edited 1 time in total.
Reason: Added code tags. Please use them yourself...

User avatar
RaptorX
Posts: 378
Joined: 06 Dec 2014, 14:27
Contact:

Re: mouse_button_left := "1" additional button

Post by RaptorX » 06 Jun 2023, 12:21

Your question is not clear enough but if you are trying to send the number 1 and a right click you have to set a key delay. Note that SendInput does not obey the key delay though so you have to use the Send command:

Code: Select all

; This code does what you are asking
f1::
SetKeyDelay 50 ; <--- Add this before using Send 
Send 1{Rbutton}
return
Projects:
AHK-ToolKit

rainrain
Posts: 45
Joined: 20 Jan 2022, 00:17

Re: mouse_button_left := "1" additional button

Post by rainrain » 08 Jun 2023, 17:34

I need to perform f1 and right click via
mouse_button_right := "f1"

User avatar
RaptorX
Posts: 378
Joined: 06 Dec 2014, 14:27
Contact:

Re: mouse_button_left := "1" additional button

Post by RaptorX » 09 Jun 2023, 08:09

rainrain wrote:
08 Jun 2023, 17:34
I need to perform f1 and right click via
mouse_button_right := "f1"
did you try this:

Code: Select all

; This code does what you are asking
f1::
SetKeyDelay 50 ; <--- Add this before using Send 
Send {F1}{Rbutton}
return
Projects:
AHK-ToolKit

Post Reply

Return to “Gaming Help (v1)”