Page 1 of 1

Press key

Posted: 19 Jul 2018, 21:52
by Aoky Carmona
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
}

Re: Press key

Posted: 20 Jul 2018, 02:02
by wolf_II
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.

Re: Press key  Topic is solved

Posted: 20 Jul 2018, 02:06
by Rohwedder
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

Re: Press key

Posted: 20 Jul 2018, 11:13
by Aoky Carmona
Thanks it works :D