I tried to use some of the example code "hotkey that temporarily reduces the mouse cursor's speed" (F1) found in
https://autohotkey.com/docs/commands/DllCall.htm
to set specific mouse sensitivities when switching between the touchpad and an external mouse, as described in e.g.
https://www.howtogeek.com/howto/45366/h ... nal-mouse/
I tried both
Code: Select all
#F1::
SPI_SETMOUSESPEED = 0x71
DllCall("SystemParametersInfo", UInt, SPI_SETMOUSESPEED, UInt, 0, Ptr, 20, UInt, 0)
and YatriTrivedi's suggestion
Code: Select all
#F1::DllCall(“SystemParametersInfo”, Int,113, Int,0, UInt,20, Int,2) ;high sensitivity
As far as I can tell, the only difference between the 2 options above (given the hex/dec conversions) is the last parameter for SPI:
"UInt, 0" = "Int, 0" vs. "Int,2".
As noted, neither of those options have any impact on the mouse sensitivity (I tried several other speed settings: "Ptr, 20", "Ptr, 10", "Ptr, 5").
When I open the Mouse Properties -> Pointer Options, the pointer speed remains at my default = mid point (10).
In contrast, the powershell method suggested by Marcus Müller, LogicLink in
https://gallery.technet.microsoft.com/s ... d-9ba16d0f
works like a charm: Within a couple of seconds, the mouse changes to the new sensitivity, and the Mouse Properties -> Pointer Options also get updated accordingly.
Given the elegancy of AHK scripts, I would really prefer to get it to work instead, esp. since the AHK script or a compiled version is easibly portable to other setups, unlike the PS solution.
I'd appreciate some enlightenment ...
THANKS!
sf32