309

Is there a way to make a mouse scroll wheel invert its direction? I'd like to scroll upwards and have that action scroll downwards and vice-versa. There is no setting on the Mouse control panel that makes this possible.

Any pointers to a hack or a particular mouse model that has such a setting would be appreciated. I am using Windows 7.

9 Answers9

404

Quick answer

  1. Open PowerShell as administrator
  2. Run:
    Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 1 }
    
  3. Reboot

Detailed explanation

There is a registry setting named FlipFlopWheel that does this!

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\HID\VID_???\VID_???\Device Parameters.

There might be multiple mouse entries. The default value for FlipFlopWheel should already be 0. Change it to 1 to invert scrolling. Reboot or replug mouse for changes to take effect.

To get the VID_??? number you have two options:

  1. Go to the mouse control panel, click the Hardware tab, then click Properties.

Now in the HID-compliant mouse Properties window click the Details tab and select the Device Instance Path property. The registry path is in there. You only have to unplug and plug back in your mouse for this to take effect.

  1. Run this in PowerShell as administrator:

     # View registry settings
     Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0
    

    Change registry settings

    Reverse mouse wheel scroll FlipFlopWheel = 1

    Normal mouse wheel scroll FlipFlopWheel = 0

    Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID**\Device` Parameters FlipFlopWheel -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 1 }

    The command for normal (non-inverted) scrolling has the 0 and 1 swapped:

     # Restore default scroll direction
     Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 1 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 0 }
    
Richard
  • 4,064
66

First install AutoHotKey. Now create a script that looks like this :

$WheelUp::
Send {WheelDown}
Return

$WheelDown::
Send {WheelUp}
Return

Save it as a .ahk file and double-click the file to run it. Now you should have inverted the mouse wheel scrolling.

All information from here, though it has been modified with the addition of the $ prefix to prevent the Send commands from being captured again by the script (which exacerbates the MaxHotkeysPerInterval issue)

Add the following to the script to invert horizontal wheel scrolling:

$WheelLeft::
Send {WheelRight}
Return

$WheelRight::
Send {WheelLeft}
Return

Scrolling with the wheel might exceed the default limit of hotkey presses in a specified time interval. By default, this is 70 hotkey presses (#MaxHotkeysPerInterval) per 2000 milliseconds (#HotkeyInterval). Add this directive to your script to increase the limit from 70 to 200 hotkey presses per interval:

#MaxHotkeysPerInterval 200
Sharken
  • 1,661
32

You can also use the application X-Mouse Button Control to accomplish this. Enable the setting "invert mouse wheel scrolling" on the "Scrolling" tab. I am using this on Windows XP, but the app should work on 7 or Vista or 10 or 11, also. It was very quick to set up, and since it's a GUI application, it was easier to use.

Screenshot

Flimm
  • 10,730
Dov
  • 675
19

I've written a small c# app to change the registry settings for all devices. It enumerates every device and changes the 'FlipFlopWheel' setting to 1 or 0 depending on which button you press.

The full source is available on github, this is the source code that actually does the flipping the registry setting (<100 lines).

For those just wanting to 'get it done', here is the executable (asks for UAC elevation)

Cadoiz
  • 567
17

Because comments are ephemeral and not to be trusted, I'm posting @Jaykul's brilliant comment on Richard's awesome answer, as an answer here.

Run Powershell as administrator, then copy/paste the following command to invert the mouse by inverting all FlipFlopWheel entries in the registry:

Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 1 }

A restart will be required after launching the command!

5

I have a Microsoft mouse attached to a bootcamped MacBook. It was easy to launch Mouse and Keyboard Center and set [Wheel->Reverse scroll direction]. Irony certainly plays a role here.

1

There's also a handy utility for that. It has a side benefit of allowing you to scroll the window under the mouse without activating it! Awesome!

Ryan_S
  • 663
1

UPDATE

Recent versions of Windows 11 finally have a per-user setting!

Try Settings → Bluetooth & devices → Mouse → Scrolling → Scrolling direction → Down motion scrolls up. It takes effect immediately, with all mice.

Alternatively, run:

REG ADD "HKCU\Control Panel\Mouse" /v ReverseMouseWheelDirection /t REG_DWORD /d 1 /f

If you have changed the registry setting (below), you will have to revert that: change the 1 after FlipFlopWheel into 0 and run the script.


OLDER VERSIONS OF WINDOWS:

I have a small .cmd script that I run whenever I use a new mouse or in a different port:

@ECHO OFF
NET FILE > NUL 2>&1 || POWERSHELL -ex Unrestricted -Command "Start-Process -Verb RunAs -FilePath '%ComSpec%' -ArgumentList '/c \"%~fnx0\" %*'" && EXIT /b
POWERSHELL -Command "Get-ItemProperty 'HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device Parameters' FlipFlopWheel -ErrorAction SilentlyContinue | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 1 }"
SET U=%PUBLIC%\Software\USBDeview\USBDeview.exe
IF EXIST "%U%" "%U%" /RunAsAdmin /disable_enable_by_class 03;01;02

The NET FILE line automatically runs the script As Administrator, unless it is elevated already.

With the last line I even don't have to unplug/replug the mouse! It does require the USBDeview executable however. If you don't want that, just replug manually.

IMHO this should actually be a per-user Windows setting: it should not depend on the mouse or port (?!), but on the user's preference!

0

FTR: Converting the comments for 2015 of Fattie ( Dec 24, 2014 at 16:52 - Dec 27, 2014 at 8:58 ) to an answer.

With Windows 8. The process is precisely the following, based on Richard's answer, Pete's critical point, and some investigation! It is 100% reliable on Windows 8 machines, nothing more is needed.

  1. bring up PowerShell as an administrator. {For those transitioning from a Mac: on Windows 8, mouse to bottom right, bring up the search, enter 'powershell', launch it. Right-click in the icon in the tab bar, change to admin running.} continue ...
  1. enter ... Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID**\Device` Parameters FlipFlopWheel -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 1 }
  2. then enter ... Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID**\Device` Parameters FlipFlopHScroll -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopHScroll 0 }
Cadoiz
  • 567