Slow down mouse by Flick

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Nobbie

Slow down mouse by Flick

06 Feb 2018, 12:05

Hello,
Im pretty new in AHK and i just need a "Simple" Script that slow down the Mouse when i move it to fast !.
And jeah, thats all ^^ Thanks.
GreatGazoo
Posts: 69
Joined: 28 Dec 2017, 02:53

Re: Slow down mouse by Flick

06 Feb 2018, 21:38

you can do that in you pc settings, change the dpi
User avatar
SL5
Posts: 879
Joined: 12 May 2015, 02:10
Contact:

Re: Slow down mouse by Flick

07 Feb 2018, 02:17

while(1){
MouseGetPos,xMouse1,yMouse2
sleep,5
MouseGetPos,xMouse2,yMouse2
if(abs(xMouse2-xMouse1) > 10)
mousemove,xMouse1,yMouse2 ; ot into the middle or so
}
Nobbie

Re: Slow down mouse by Flick

07 Feb 2018, 08:10

SL5 wrote:while(1){
MouseGetPos,xMouse1,yMouse2
sleep,5
MouseGetPos,xMouse2,yMouse2
if(abs(xMouse2-xMouse1) > 10)
mousemove,xMouse1,yMouse2 ; ot into the middle or so
}
First of all, thanks! but how can i change "how fast i need to move" to get slower ?. I tryed to change the 10 but its didnt work :/.

Edit: I found this Script here,

Code: Select all

; Example: This is a hotkey that temporarily reduces the mouse cursor's speed, which facilitates precise positioning.
; Hold down the F1 key to slow down the cursor. Release it to return to original speed.

F1::
SPI_GETMOUSESPEED = 0x70
SPI_SETMOUSESPEED = 0x71
; Retrieve the current speed so that it can be restored later:
DllCall("SystemParametersInfo", UInt, SPI_GETMOUSESPEED, UInt, 0, UIntP, OrigMouseSpeed, UInt, 0)
; Now set the mouse to the slower speed specified in the next-to-last parameter (the range is 1-20, 10 is default):
DllCall("SystemParametersInfo", UInt, SPI_SETMOUSESPEED, UInt, 0, Ptr, 3, UInt, 0)
KeyWait F1  ; This prevents keyboard auto-repeat from doing the DllCall repeatedly.
return

F1 up::DllCall("SystemParametersInfo", UInt, 0x71, UInt, 0, Ptr, OrigMouseSpeed, UInt, 0)  ; Restore the original speed.
Is it possible to make it so,
- If the mouse speed is to fast (25) than its Activate the Script and if the mouse is not faster than 25 its have the original speed.
User avatar
SL5
Posts: 879
Joined: 12 May 2015, 02:10
Contact:

Re: Slow down mouse by Flick

07 Feb 2018, 08:40

My plan was to measure distance. the shorter the interval the more even. you can then invent to you a rule, what should happen if the move was too much for this time. whether he has half the plug back or only 75% back or so.
asdsadsa

Re: Slow down mouse by Flick

07 Feb 2018, 08:54

SL5 wrote:My plan was to measure distance. the shorter the interval the more even. you can then invent to you a rule, what should happen if the move was too much for this time. whether he has half the plug back or only 75% back or so.
I fixed it, thanks.
asdasd

Re: Slow down mouse by Flick

07 Feb 2018, 09:09

SL5 wrote:My plan was to measure distance. the shorter the interval the more even. you can then invent to you a rule, what should happen if the move was too much for this time. whether he has half the plug back or only 75% back or so.
I understand your Plan but how its move, it so ... (Nothing for me) and than i found this Script here about MouseSpeed and i found it awesome and because this i want it so, so i tryed out my self but didnt got it why its wont work. Its look so now,

Code: Select all

MouseGetPos,xMouse1,yMouse2
if(abs(xMouse1-xMouse1) > 50) {
	
	SPI_GETMOUSESPEED = 0x70
	SPI_SETMOUSESPEED = 0x71
	
	DllCall("SystemParametersInfo", UInt, SPI_GETMOUSESPEED, UInt, 0, UIntP, OrigMouseSpeed, UInt, 0)	; Its save the Normal Mouse speed
	DllCall("SystemParametersInfo", UInt, SPI_SETMOUSESPEED, UInt, 0, Ptr, 3, UInt, 0)									; Now its make it slower 

 } else {
 
DllCall("SystemParametersInfo", UInt, 0x71, UInt, 0, Ptr, OrigMouseSpeed, UInt, 0) 							 			; Restore the original speed.
}
Maybe you know what is the Problem because you know good AHK ;) thanks
User avatar
SL5
Posts: 879
Joined: 12 May 2015, 02:10
Contact:

Re: Slow down mouse by Flick

07 Feb 2018, 12:21

asdasd wrote: Maybe you know what is the Problem because you know good AHK ;) thanks
I have not tested your script and suspect that it does something else anyway. maybe it's about the mouse speed when the computer controls it. that's nothing special. but to prevent the user from moving quickly, I can only remember the last idea. sorry. may it takes days of hard work for you to find a good mixure.
User avatar
SL5
Posts: 879
Joined: 12 May 2015, 02:10
Contact:

Re: Slow down mouse by Flick

07 Feb 2018, 16:56

Code: Select all

#SingleInstance,force
; prototype1
while(1){
	MouseGetPos,x1,y2
	sleep,15
	MouseGetPos,x2,y2
	if(abs(x2-x1) > 2 || abs(y2-y1) > 2){
		ToolTip,youre moveing to fast 
		;mousemove,xMouse1,yMouse2 ; ot into the middle or so
	}else
		ToolTip,
}

Code: Select all

#SingleInstance,force

;ExitApp
CoordMode, Mouse, Screen
SetBatchLines, -1
; prototype2
while(1){
	MouseGetPos,x1,y1
	Sleep,1
	MouseGetPos,x2,y2
	if(abs(x2-x1) > 2 || abs(y2-y1) > 2){
		ToolTip,youre moveing to fast 
		;mousemove,% (x1+x2)/2,% (y1+y2)/2 ; a little slower
		;mousemove,% x1,% y1 ,0
		; DllCall("SetCursorPos", int, (x1+x2)/2, int, (y1+y2)/2)
		DllCall("SetCursorPos", int, x1, int, y1)
	}else
		ToolTip,
}

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: scriptor2016 and 372 guests