Centering Cursor Topic is solved
Centering Cursor
Hey, can someone make me a script that makes my cursor stays center of the screen, basically to stop my cursor to move from the center of the screen. A help would beappreciated.
Re: Centering Cursor Topic is solved
Try this. Press F1 to start/stop. And press esc when you want to exit the script.
edit: Update your script the variable had a syntax error and I forgot coordmode.
edit: Update your script the variable had a syntax error and I forgot coordmode.
Code: Select all
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#MaxThreadsPerHotkey 2
CoordMode, Mouse, Screen
toggle := 0
F1::
Toggle := !Toggle
While Toggle
{
Mousemove, (A_ScreenWidth // 2), (A_ScreenHeight // 2)
Sleep 50
}
return
esc:: ExitApp ; exits the script
Last edited by Nwb on 25 Feb 2018, 06:00, edited 3 times in total.
I am your average ahk newbie. Just.. a tat more cute.
Re: Centering Cursor
Well thank you for the help but, when i tried to Run the script, the script error at line 9 Line Text "%A_ScreenWidth". I'm new to this scripting, any solution ?Nwb wrote:Try this. Press F1 to start/stop. And press esc when you want to exit the script.
Code: Select all
F1:: Toggle = !Toggle If Toggle Loop { If not Toggle break else Mousemove, %A_ScreenWidth/2, %A_ScreenHeight/2 Sleep 50 } return esc:: ExitApp
Re: Centering Cursor
Okay try the new edited script. It should work perfectly now!Bry wrote:Well thank you for the help but, when i tried to Run the script, the script error at line 9 Line Text "%A_ScreenWidth". I'm new to this scripting, any solution ?Nwb wrote:Try this. Press F1 to start/stop. And press esc when you want to exit the script.
Code: Select all
F1:: Toggle = !Toggle If Toggle Loop { If not Toggle break else Mousemove, %A_ScreenWidth/2, %A_ScreenHeight/2 Sleep 50 } return esc:: ExitApp
Press f1 to start centering your mouse and press f1 again if you want it to stop.
I am your average ahk newbie. Just.. a tat more cute.
Who is online
Users browsing this forum: No registered users and 48 guests