Inverting direction of mouse scroll wheel

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 }
    

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

You can also use the application X-Mouse Button Control to accomplish this. You only need to set the "Wheel Up" button to the "Scroll Window Down" command, and vice-versa. I am using this on Windows XP, but the app should work on 7 or Vista, also. It was very quick to set up, and since it's a GUI application, it was easier to use.