Hello,
I want to write a script that sets my mouse speed under windows low while holding down a key on my keyboard. That is for precise positioning in a program (so the normal speed is for usual work and the lowered speed to pixel-accurate mouse cursor positioning).
I know how to check if a key is pressed, but is it possible to set the mouse speed (not only for the MouseMove but the overall windows mouse sensitivity) ?
Thanks a lot for your help
Set the Mouse Speed/Sensitivity
Started by
Guest
, Sep 30 2005 03:39 PM
9 replies to this topic
#1
-
Posted 30 September 2005 - 03:39 PM
NoNicknameAlert? Isn't it allowed to post without registering? Sorry for that, so I registered a nickname.
Anyway, does anyone have an idea regarding my question?
Anyway, does anyone have an idea regarding my question?
#3
-
Posted 30 September 2005 - 09:32 PM
You can choose and use a nick without being registered. Look at mine :wink:.
Anyway, thx for your understanding. That will it make easier for you, me & all the folks out there to identify and support you. Good luck and have fun
Anyway, thx for your understanding. That will it make easier for you, me & all the folks out there to identify and support you. Good luck and have fun
#4
-
Posted 30 September 2005 - 10:50 PM
See above.
I would like to suggest that you create an account that has a "special" name and then post your tips using that account. At least we'd know that your (somewhat) for real, and I will know what your posts are about and just skip reading them.
I suggest... ForumTipper
I would like to suggest that you create an account that has a "special" name and then post your tips using that account. At least we'd know that your (somewhat) for real, and I will know what your posts are about and just skip reading them.
I suggest... ForumTipper
#5
-
Posted 01 October 2005 - 12:42 AM
The following seems to work. You would hold down your F1 key while moving the mouse cursor to make the cursor very slow:I want to write a script that sets my mouse speed under windows low while holding down a key on my keyboard.
; The first parameter is always 0x71 (SPI_SETMOUSESPEED). ; The third parameter is the speed (range is 1-20, 10 is default). F1:: DllCall("SystemParametersInfo", UInt, 0x71, UInt, 0, UInt, 3, UInt, 0) KeyWait F1 ; This prevents keyboard auto-repeat from doing the DllCall repeatedly. return F1 up::DllCall("SystemParametersInfo", UInt, 0x71, UInt, 0, UInt, 10, UInt, 0)
#6
-
Posted 01 October 2005 - 01:42 AM
If you see my nick next to a posting (at the forum index) you can act that way, as the content is all about to choose a nick. Nothing else. Happy scripting everybody & have fun.and I will know what your posts are about and just skip reading them
#7
-
Posted 01 October 2005 - 09:10 AM
The following seems to work. You would hold down your F1 key while moving the mouse cursor to make the cursor very slow:
....
Thanks a lot, I will test it tonight. I didn't know that there's a "F1 up::",so my script recognizes when I release the F1 key (I'm very new to AHK)... I found this sample in the AHK help file to simulate a "hold mouse button down" with a key:
*F1:: MouseClick, middle,,, 1, 0, D Loop { Sleep, 10 GetKeyState, state, F1, P if state = U break } MouseClick, middle,,, 1, 0, U return
Now where I know there is a "F1 up::", has the following code the same functionality? :
*F1:: MouseClick, middle,,, 1, 0, D KeyWait F1 return *F1 up:: MouseClick, middle,,, 1, 0, U return
Sorry for beeing off-topic, but is there a difference between those two scripts?
#8
-
Posted 01 October 2005 - 03:43 PM
I think they're functionally identical, so whichever you want to use should be fine (though key-up hotkeys might require that you upgrade your AutoHotkey if it's old). Scripts that use key-up hotkeys are probably a little more efficient than ones that use KeyWait to achieve the same thing.is there a difference between those two scripts?
#9
-
Posted 01 October 2005 - 06:00 PM
Ok, thanks for the info.... and btw: I just tried your mouse speed solution, and it works perfectly for me Thanks a lot.
#10
-
Posted 01 October 2005 - 09:00 PM