Jump to content

Recommended Posts

Posted

I'm trying to make a script that slows down my mouse sensitivity when a certain event is happening, and then reverts to normal after the event is over.

I got this code to work, but the problem is that it doesn't have any effect on my mouse speed when I'm tabbed into the program I'm trying to use it for. Is there anything I can do to get it to work in a specific program? Or even another way of doing this code.

#Include <WinAPIEx.au3>

Global $SpeedOrig = RegRead("HKCU\Control Panel\Mouse", "MouseSensitivity")
_WinAPI_SystemParametersInfo(113, 0, 1, 2) ; 1 = slowest
Sleep(2000)
_WinAPI_SystemParametersInfo(113, 0, 20, 2) ; 20 = fastest
Sleep(2000)
_WinAPI_SystemParametersInfo(113, 0, $SpeedOrig, 2)
Posted (edited)

look in help F1  with word cursor or

try to refresh registry

ProcessClose("explorer.exe")
Run ("explorer.exe")
Edited by faustf
Posted (edited)

Your program needs to capture the  WM_SETTINGCHANGE message.  Looks like it doesn't.  Maybe it is because this program ensure itself of mouse speed ?

You could try to use 3 as the last parameter.  

ps.  I tested on multiple applications, and it is working fine.  I wonder what is the program you're talking about ?

Edited by Nine
Posted (edited)
4 hours ago, Nine said:

Your program needs to capture the  WM_SETTINGCHANGE message.  Looks like it doesn't.  Maybe it is because this program ensure itself of mouse speed ?

You could try to use 3 as the last parameter.  

ps.  I tested on multiple applications, and it is working fine.  I wonder what is the program you're talking about ?

Its a video game I'm trying to make it work in, so I guess it might read input differently. For example, a script that makes the cursor go downward while holding a key flips out in-game. The parameter change didn't work. I wonder if there's a way to pull the mouse speed from my mouse drivers (Razer Synapse) instead.

Edited by autoside
  • Moderators
Posted

Welcome to the AutoIt forum.

Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked.

See you soon with a legitimate question I hope.

The Moderation team

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Guest
This topic is now closed to further replies.
×
×
  • Create New...