Is there any way (using autohotkey or not) to create a shortcut (two, actually) for modifying the mouse/touchpad pointer speed ?

I have two mices, and one touchpad, which I use alternatively ... and every one of them somehow differently sets its pointer speed. In any case, very annoying. I also, sometimes would like to have touchpad at a greater speed, depending on what I'm doing at the moment.

So, does anyone know how that could be accomplished ? All ideas on the subject welcomed.

link|improve this question

62% accept rate
feedback

2 Answers

up vote 1 down vote accepted

The registry key is loated in HKEY_CURRENT_USER\Control Panel\Mouse\MouseSensitivity but modifying this through AutoHotkey alone usually doesn't work. The best way is to use a DLL call:

^+u::DllCall("SystemParametersInfo", Int,113, Int,0, UInt,20, Int,2) ;high sensitivity
^+d::DllCall("SystemParametersInfo", Int,113, Int,0, UInt,5, Int,2) ;low sensitivity
^+n::DllCall("SystemParametersInfo", Int,113, Int,0, UInt,10, Int,2) ;normal sensisivity

Ctrl + Shift + u sets sensitivity to high, Ctrl + Shift + d sets it low, and Ctrl + Shift + n sets it back to default. Edit this script to your hearts content.

But, what you could use the registry for is querying the current value, so you can increment the speed by 1 like so:

^+u::
RegRead, MyVar, HKEY_CURRENT_USER, Control Panel\Mouse,MouseSensitivity
if (MyVar == 20)
{
    MsgBox Value is already at max
    Exit, 0
}
DllCall("SystemParametersInfo", Int,113, Int,0, UInt,%MyVar%+1, Int,2)
return
link|improve this answer
feedback

See if this AutoHotKey forum thread helps you: Adjusting Mouse Sensitivity via hotkey

link|improve this answer
1  
It's always good to paste the text here as well (if it isn't a lot). If the links die so does your answer. No hard feelings, just a heads up. I've gotten comments from people saying links are down (example pictures if I remember) and I couldn't find a replacement so I had to delete my answer because it was irrelevant without them. – John T Oct 24 '09 at 3:38
@John, I understand your point. But, this time I had not checked the answer enough to confirm it would work here. Thought the OP would put in the right answer if it works. – nik Oct 25 '09 at 13:11
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.