Press key Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Aoky Carmona
Posts: 3
Joined: 19 Jul 2018, 21:45

Press key

19 Jul 2018, 21:52

Hi, I would like to know if theres a way to make a script that does the following things:
-While I keep pressed the "MButton" it executes "spacebar(down)and left click (down)"
-When I release the MButton it makes the opposite "spacebar(Up) and Left click (Up)"
This is a sample code that I made (i'm still new in this)

Code: Select all

{If WinActivate, ahk_class indesign
	MButton::
		Send, {Space Down}
		MouseClick, Left,,, 1, 0, D
		Loop
		{
			Sleep, 10 
			If GetKeyState["MButton", "P"]
				Break
		}
		MouseClick, left,,, 1, 0, U
		sleep 10
		Send, {Space Up}
	Return
}
wolf_II
Posts: 2688
Joined: 08 Feb 2015, 20:55

Re: Press key

20 Jul 2018, 02:02

Try this: (not tested)

Code: Select all

#IfWinActive, ahk_class indesign
MButton:: Send, {Space Down}{LButton Down}
MButton Up:: Send, {Space Up}{LButton Up}
I hope that helps.
Rohwedder
Posts: 7634
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Press key  Topic is solved

20 Jul 2018, 02:06

Hallo,
try this Remapping variation:

Code: Select all

#IfWinActive ahk_class indesign
*MButton::
Send {Blind}{Space DownR}
Sleep, 10
Send {Blind}{LButton DownR}
Return
*MButton up::
Send {Blind}{Space Up}
Sleep, 10
Send {Blind}{LButton Up}
Return
#IfWinActive
Aoky Carmona
Posts: 3
Joined: 19 Jul 2018, 21:45

Re: Press key

20 Jul 2018, 11:13

Thanks it works :D

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Rohwedder and 269 guests