Inverting direction of mouse scroll wheel

292

187

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.

Christian Correa

Posted 2011-07-14T22:09:18.023

Reputation: 3 051

2FTR for 2015. 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.} cont... – Fattie – 2014-12-24T16:52:37.887

3enter ... Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\\\Device` Parameters FlipFlopWheel -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 1 } – Fattie – 2014-12-27T08:57:41.563

2then enter .. Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\\\Device` Parameters FlipFlopHScroll -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopHScroll 0 } – Fattie – 2014-12-27T08:58:13.083

2it's extremely hard to enter those in comments :) – Fattie – 2014-12-27T08:59:03.797

So why would you not post it as an answer when it so obviously is one? – user1901982 – 2019-10-16T12:09:11.003

Answers

378

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.

  2. Run this in PowerShell (from Start » All Programs » Accessories » Windows PowerShell):

    # 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

Posted 2011-07-14T22:09:18.023

Reputation: 3 804

Yay! Now my mouse works on my work PC like it does on my personal Mac!! – DemiSheep – 2014-08-01T14:51:54.403

Yes! Confirmed for Windows 8.1 build 9600 – DaddyM – 2014-08-13T19:50:56.777

4Note that the PowerShell command has to be run as administrator. It's all you have to do though, it just goes in and sets the property for every single VID_???. – Nelson – 2014-10-25T15:38:36.873

Note: you can use Regedit to find these. Just open the start menu, and type "regedit" and hit return. Then search for "flipflopwheel", and the right area in the keys should come up. – Almo – 2014-10-27T13:38:30.790

I think this answer should be re-worded to make it clear the #2 part actually implements the changes to the registry. I.e. it doesn't just "get the VID_??? number," as is stated. In other words, you probably just want to run #2 and be done with it. – Mason G. Zhwiti – 2014-12-08T17:13:39.363

2I found that the FlipFlopWheel setting was missing entirely for one mouse I tried, which meant the Powershell script couldn't find it. Looking up the device instance path manually and editing the registry worked fine - I just needed to create a new REG_DWORD called FlipFlopWheel in the right place. – Weeble – 2015-04-27T09:12:31.987

8Just wanted to note that this PowerShell command does indeed work in Windows 10 as well. – Bobby – 2015-08-01T17:30:38.857

2@Jaykul's comment should be the accepted answer. All I had to do was paste the command in an Administrator Powershell and it worked after unplugging/re-plugging my mouse. – Bill Mote – 2015-12-15T22:04:22.863

3This worked for me, although I had to figure out that I need to unplug/replug my mouse after running the command. Without that Windows (at least Win7) does not re-read the mouse config from the Registry. I think this should be included in the answer. – Czar – 2016-04-15T20:31:50.423

1This worked to invert the mouse. BUT wouldn't work to set the mouse back to the original setting. I am getting this: Get-ItemProperty : Property FlipFlopWheel does not exist at path – Snowcrash – 2016-07-26T17:48:46.523

1seems like if you later plug your mouse into a different USB port you will have to do this again (on Windows 10 at least) – Jack – 2016-08-22T19:37:27.643

I had to plug in my mouse on all USB-ports and those of the hub(s) first so these will have the drivers installed before i was able to use this trick for all. – Dediqated – 2016-09-15T19:21:11.920

Well, my edit was rejected (man, Stack Overflow needs to de-mean-ify the "your edit does not make this post even a little bit easier to read, or more helpful" stock-text ...); but could OP please line-break those really long lines with ``` in the source-code? In every browser I've tried, they fall off the right side, which makes them really hard to sight-type when copy-paste is unavailable. – ELLIOTTCABLE – 2016-10-26T20:30:51.623

I would say that to get the VID_??? number you have an easier third option - simply click on each device and change FlipFlopWheel to 1 wherever you find a key named FlipFlopWheel. – k2col – 2016-11-08T03:28:07.297

1Just doesn't work on the latest version of Windows 10 (Logitech mouse). – Dmitry – 2017-09-09T08:21:30.483

It did work for me on Windows 10 (for both the trackpad and a bluetooth mouse), but like @Snowcrash said: it didn't work when I tried to change it back to the original setting again. Solution for me was from @Almo - using regedit and searching for flipflopwheel (Note you have to Ctrl+f and click "Find next" multiple times to find all of the relevant keys - I had about 6). – jackocnr – 2017-09-14T09:25:15.087

In Windows 7 I added the FlipFlopHScroll key and set its value to 1. Inverted horizontal scrolling works now too. It requires a reboot I believe. – Samuel – 2018-01-19T16:42:23.070

+1 for the line Reboot or replug mouse for changes to take effect.. – Prasanna – 2018-04-09T09:00:07.373

I got Windows-10 and a Bluetooth mouse. Instead of plug out and in, I have to disconnect and reconnect it in the Bluetooth preferences. After reconnect, there is a new registry entry with the last digit counted up. (In the style: "{01234567-0124-0125-0126-0127456789ab}_Dev_VID&012845_PID&0129_REV&012a_012b456789ab" while after reconnect it ends "…12b456789ac".) The new entry has set FlipFlopWheel to 0, so it doesn't work. Any Ideas for Bluetooth? – Peter – 2018-07-12T12:53:35.333

7In Windows 8 there is also a setting for "FlipFlopHScroll" that flips the horizontal scrolling (especially useful for Win8). – Pete Amundson – 2012-08-02T14:25:59.270

Does anyone know if adding this key to a PS/2 mouse works as well? – Alo – 2012-09-15T00:28:52.663

94Don't worry about what the ??? should be, just run this in PowerShell: Get-ItemProperty HKLM:\SYSTEM\CurrentControlSet\Enum\HID\*\*\Device` Parameters FlipFlopWheel -EA 0 | ForEach-Object { Set-ItemProperty $_.PSPath FlipFlopWheel 1 } – Jaykul – 2012-09-16T03:28:00.963

I'm sure I've followed the steps in this answer before, but the machine I'm on right now does not have the HID registry folder in that location or anywhere else in the registry. It's an HP EliteBook running Windows 7. Any ideas on where else to look? – CoderDennis – 2013-03-15T15:04:08.953

3How to find the correct registry key? The key must match the hardware id of your mouse. To find that: Control Panel > Device Manager > Mice... > HID-compliant mouse > right click > properties > Details > Property (dropdown) = Hardware Ids > you will see the id on 1st line, this should match one of the entries in registry above. – Marwan – 2013-06-16T06:13:06.307

65

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

Posted 2011-07-14T22:09:18.023

Reputation: 1 605

While this works, my M500 has a button that lets the mouse scroll fast... I've tried changing the suggested #MaxHotkeysPerInterval setting, and it still didn't work in suppressing the error message. – Tracker1 – 2015-08-08T23:59:42.513

I'll try this out at work and if it works I'll tag your answer as the right answer. Thanks! – Christian Correa – 2011-07-14T23:10:30.920

Works great. It's not perfect, every now and then it won't catch the "key" event, but as long as you keep scrolling, the very next event will be caught. The net effect is what I was looking for. So that would have to do for now, until manufacturers make this option configurable in Windows. Thanks! – Christian Correa – 2011-07-15T19:07:54.630

7There is an option in registry as suggested by Richard. – tig – 2012-02-01T15:44:46.190

This one works best if your access policy prohibits editing the registry. Great idea! – mattmc3 – 2014-01-22T20:08:24.120

1+1 For my Windows 7 installation this was the answer that allowed me to invert horizontal scrolling. – Chris Schiffhauer – 2014-02-17T17:12:58.690

29

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.

Dov

Posted 2011-07-14T22:09:18.023

Reputation: 635

3v2.2 has an "invert mouse wheel scrolling" on the "Scrolling & Navigation" tab. – Lars Truijens – 2011-11-14T20:26:14.387

I installed X-Mouse Button Control on my Windows 7 and scrolling is now reversed. Works perfect. Same direction as my home Mac with OS X Lion.

– Magnus – 2011-08-02T07:11:44.647

17

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, the source code that actually does the flipping the registry setting (<100 lines) is here: https://github.com/jamie-pate/flipflop-windows-wheel/blob/master/Form1.cs

for those just wanting to 'get it done' here is the executable (asks for UAC elevation) https://github.com/jamie-pate/flipflop-windows-wheel/blob/master/bin/Debug/FlipWheel.exe

Jamie Pate

Posted 2011-07-14T22:09:18.023

Reputation: 279

1@samayres1992 He added the extra info a day after Oliver's original comment... – Bob – 2014-09-08T05:34:50.393

Thanks Jamie! I notice it filters on hid.mousedevice initially. Pity Razer mice don't seem to publish as such, fortunately your app allows to show all input devices. Just gets a bit cryptic... – Marius – 2015-08-15T15:55:32.597

Just raise an issue on github with the device name string, i'll add it to the initial filter list. (I only have a logitech mouse which shows up as "@msmouse.inf,%hid.mousedevice%;HID-compliant mouse" so it'd be interesting to see what other device brands use for that string. – Jamie Pate – 2015-08-15T19:56:44.093

4People usually like to read a little more about your application before downloading and running a .exe ;) Please extend your answer and write a proper introduction. Please also refrain from simply adding your link to other answers unless you really feel like it improves the answer at hand. – Der Hochstapler – 2012-07-29T18:22:16.490

1The guy provided the source code for the executable, it's hardly mischievous if you feel inclined to check it, just look at it, it's a tiny script.

Thanks for the script @JamiePate, it worked great. It was nice not having to tinker with the registry. – samayres1992 – 2014-03-04T01:46:51.633

12

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!

Chris Cirefice

Posted 2011-07-14T22:09:18.023

Reputation: 267

That worked like a charm with Bootcamp and Windows 10! – Anytoe – 2017-07-23T16:40:07.550

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.

Kenneth Laskoski

Posted 2011-07-14T22:09:18.023

Reputation: 51

For Windows 8, the best way is to install Microsoft Mouse and Keyboard Center from http://www.microsoft.com/hardware/en-us/downloads/mouse-keyboard-center, and then use the "Flip Scrolling Direction" option in the basic settings for your mouse. Louis mentioned this in passing above, and it worked perfectly on my Surface Pro.

– David Smith – 2015-05-08T15:41:44.863

3Just for clarity: Mouse and Keyboard Center comes with Microsoft hardware and is unrelated to Macs. – Louis – 2012-11-02T06:34:05.803

Thank you, Louis! This shall not be overlooked. – Kenneth Laskoski – 2012-11-04T03:46:59.303

3This setting does not seem to be reloaded after reboot in Win8. The setting is shown as on when you go into the dialog. But it needs to be turned off then back on to re-enable. – Metro – 2013-01-15T22:34:06.673

Yes, I recently upgraded to Windows 8 and noticed that, too. I ended up using @Richard's method. – Kenneth Laskoski – 2013-01-16T19:56:45.590

Note that @Jaykul's (otherwise convenient) shortcut may not work for everyone. In my case I needed to invert the wheel in native Windows, but sometimes I open the same Windows in VirtualBox, which already takes care of mouse/keyboard input. – Kenneth Laskoski – 2013-02-09T06:45:48.710

1

Confirm again X-Mouse Button Control http://www.highrez.co.uk/downloads/XMouseButtonControl.htm is a clean and perfect solution on Windows 7 :)

Aukrit Mr-Eark Chadagorn

Posted 2011-07-14T22:09:18.023

Reputation: 11

1

What makes it clean and perfect? Can you please summarize what's in that page so your answer is still useful if it changes or becomes unavailable? Please read the help article on answering.

– Moses – 2013-10-11T23:33:15.260

0

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!

http://antibody-software.com/web/software/software/wizmouse-makes-your-mouse-wheel-work-on-the-window-under-the-mouse/

Ryan_S

Posted 2011-07-14T22:09:18.023

Reputation: 624