8

When I work in Windows XP and 7 I want mouse acceleration to be on using the default settings. However, when I'm using some applications like Photoshop or games such as First Person Shooters I need it to be turned off.

I'm currently switching it on and off by opening the mouse settings dialog box and turning it on or off there but that is getting really, really old. Especially if I boot up Team Fortress 2, and join a server only to realize I forgot to turn it off so I have to close it down and do it all again. Very old.

I tried creating two reg files that changed the needed values in HKEY_CURRENT_USER/Control Panel/Mouse, but that did not work. There must be something needed for the change to trigger.

So I'm looking for an alternative. A keyboard shortcut would probably be the most simple and reliable way to do it, such as ALT+F11 to turn it off, ALT+F12 to turn it on, or even better, ALT+F12 to toggle it. I don't think those shortcuts would interfere with anything else.

There's just one problem - how do I make this happen? I'm not a programmer.

4
  • 2
    What about disabling mouse acceleration forever, then increasing the sensitivity on Windows so it moves faster and adjust the settings accordingly in-game to counter the faster movement by decreasing the sensitivity? Jul 5, 2010 at 15:51
  • 1
    No, that's not what I'm looking to do.
    – Don
    Jul 5, 2010 at 16:19
  • Why do you absolutely need mouse acceleration? @TomWij's suggestion sounds reasonable to me. Jul 6, 2010 at 22:26
  • If you're not wanting to use AHK, it's be advisable to purchase a mouse with multi-DPI support + precision mode. Logitech's G602 (or G502 for wired) are solid picks, and are the best in industry for wireless precision.
    – Arctiic
    Feb 1, 2023 at 2:50

2 Answers 2

2

AutoHotkey could be used to automate the encapsulating the whole process you need to undertake in a single hotkey that will go and toggle the checkbox for you, unless someone writes special software for you this would be the only way to accomplish that task.

Either automate it through a script or get rid of the acceleration... ;-)

2
  • Would AutoHotkey be able to do that the background without disrupting fullscreen applications? I have not used AHK before.
    – Don
    Jul 10, 2010 at 16:09
  • If opening the windows doesn't cause the full-screen application to be minimized then you could do it with AutoHotkey or AutoIt, what you usually do is command it to do mouse clicks or key presses. But I think it is possible to ask it to press specific buttons by a text they contain. They have a big community, if you get stuck somewhere you could ask how to automate your specific task on their forum. Jul 10, 2010 at 17:05
0

Just found this question because I had the same one. My use-case is that I have two mice, one regular and one with a trackball. Most of the time I use the trackball and for that I need mouse acceleration on. But I game on the regular mouse and there I can't do anything precise with acceleration on.

So I made this script to toggle the setting between of an on:

$RegistryPath = 'HKCU:\Control Panel\Mouse'

# Get current mouse speed setting (1 = acceleration on; 0 = acceleration off)
$mode = (Get-ItemProperty -Path $RegistryPath -Name MouseSpeed).MouseSpeed
if ($mode -eq 1) {
    # Toggle off
    New-ItemProperty -Path $RegistryPath -Name 'MouseSpeed' -Value '0' -PropertyType String -Force
    New-ItemProperty -Path $RegistryPath -Name 'MouseThreshold1' -Value '0' -PropertyType String -Force
    New-ItemProperty -Path $RegistryPath -Name 'MouseThreshold2' -Value '0' -PropertyType String -Force
}
else {
    # Toggle on
    New-ItemProperty -Path $RegistryPath -Name 'MouseSpeed' -Value '1' -PropertyType String -Force
    New-ItemProperty -Path $RegistryPath -Name 'MouseThreshold1' -Value '6' -PropertyType String -Force
    New-ItemProperty -Path $RegistryPath -Name 'MouseThreshold2' -Value '10' -PropertyType String -Force
}

# Apply the registry settings we just changed, solution from: https://superuser.com/a/1650546/957702 
Add-Type @"
using System.Runtime.InteropServices;
public class PInvoke {
    [DllImport("user32.dll")] public static extern int SystemParametersInfo(int uiAction, int uiParam, int[] pvParam, int fWinIni);
    [DllImport("user32.dll")] public static extern int SystemParametersInfo(int uiAction, int uiParam, System.IntPtr pvParam, int fWinIni);
}
"@

$mouse = Get-ItemProperty $RegistryPath

# MouseThreshold1, MouseThreshold2, MouseSpeed -> SPI_SETMOUSE
[PInvoke]::SystemParametersInfo(0x0004, 0, [int[]]($mouse.MouseThreshold1, $mouse.MouseThreshold2, $mouse.MouseSpeed), 0)

Put the above in a .ps1 file and trigger it however you like.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .