Small increments but rapid mouse movement when a key is pressed?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Poebear
Posts: 19
Joined: 26 Aug 2016, 13:41

Small increments but rapid mouse movement when a key is pressed?

08 Nov 2017, 20:28

Is there any way to have a script where, when I press the {r} key while the {a} key is being held down, it rapidly moves my mouse to the right in short increments? And then move my mouse to the left when the d key is being held down and r is pressed in the same manner?

Thank you
HIAC
Posts: 111
Joined: 11 Oct 2017, 17:59
Location: Republic of Serbia

Re: Small increments but rapid mouse movement when a key is pressed?

08 Nov 2017, 20:49

Hope this helps:

Code: Select all

Loop,
{
While (GetKeyState("a", "P") && GetKeyState("r", "P"))
	MouseMove, 1279, 308 ; X,Y Coordinates
While (GetKeyState("d", "P") && GetKeyState("r", "P"))
	MouseMove, 0, 418 ; X,Y Coordinates
}
scriptor2016
Posts: 854
Joined: 21 Dec 2015, 02:34

Re: Small increments but rapid mouse movement when a key is pressed?

09 Nov 2017, 00:27

sounds like you're trying to rotate the canvas in an art application. Is it Photoshop?

If so, try this. Just hold down r, and then hold down either a or d at the same time. No need to hold down lbutton.

Code: Select all

Loop,
{
While (GetKeyState("a", "P") && GetKeyState("r", "P"))
{
MouseMove, 100, 0, 10, R 
}


While (GetKeyState("d", "P") && GetKeyState("r", "P"))
{	 
MouseMove, -100, 0, 10, R
}  
}  
return

~r::
sendinput {lbutton down}
return

r up::
sendinput {lbutton up}
return

esc::
exitapp
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput, Lamron750, mikeyww and 228 guests