Last active
December 23, 2021 23:17
-
-
Save GaliTW/6e6ad060aedb15b10b51429b3281e7fc to your computer and use it in GitHub Desktop.
AutoHotKey's script for Sniper Mode(Left Windows Key + N Key)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Example: This is a hotkey that temporarily reduces the mouse cursor's speed, which facilitates precise positioning. | |
; Hold down the Hot key to slow down the cursor. Release it to return to original speed. | |
LWin & n:: | |
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, UInt, 10, UInt, 0) | |
KeyWait, LWin, n; This prevents keyboard auto-repeat from doing the DllCall repeatedly. | |
return | |
LWin & n up::DllCall("SystemParametersInfo", UInt, 0x71, UInt, 0, UInt, OrigMouseSpeed, UInt, 0) ; Restore the original speed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment