Quantcast
Channel: AutoHotkey Community
Viewing all articles
Browse latest Browse all 579

Ask for Help (v2) • Re: Adjusting mouse sensitivity with hotkeys

$
0
0

How do I use LButton as a hotkey in this case, without losing LButton's default function?


Put ~ in front of the hotkey:

CODE:

~LButton::MouseSpeedToggleHold(3) ; change the speed here

MouseSpeedToggleHold(newSpeed) {
static GetMouseSpeed := 0x70
static SetMouseSpeed := 0x71
DllCall("SystemParametersInfo", "UInt", GetMouseSpeed, "UInt", 0, "UIntP", &originalSpeed:=0, "UInt", 0) ; Get the original speed
DllCall("SystemParametersInfo", "UInt", SetMouseSpeed, "UInt", 0, "UInt", newSpeed, "UInt", 0) ; set the new speed
KeyWait RegExReplace(A_ThisHotkey, "^.*?(\w+)$", "$1") ; wait for this hotkey
DllCall("SystemParametersInfo", "UInt", SetMouseSpeed, "UInt", 0, "UInt", originalSpeed, "UInt", 0) ; restore the speed
}

Statistics: Posted by ntepa — Today, 14:37



Viewing all articles
Browse latest Browse all 579

Trending Articles