Skip to content

Instantly share code, notes, and snippets.

@rbeesley
Last active November 8, 2021 23:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rbeesley/5575c85ef85954f509fc499ff31061b3 to your computer and use it in GitHub Desktop.
Save rbeesley/5575c85ef85954f509fc499ff31061b3 to your computer and use it in GitHub Desktop.
Use the scroll wheel the way it was intended. Run as an Administrator. This configures all mice scroll wheels to use Natural Scrolling or Australian Scrolling. Instead of the mouse wheel controlling the scrollbar thumb, it relates to the content you're viewing. Up on the scroll wheel equates to scrolling the page up.
$mice = Get-PnpDevice | Where-Object {$_.FriendlyName -like "*mouse*"}
$updatedMice = @()
$ErrorActionPreference = "Stop"
foreach ($mouse in $mice) {
$mouseDeviceParametersPath = $(Join-Path $(Join-Path "HKLM:\SYSTEM\CurrentControlSet\Enum\" $mouse.InstanceId) "Device Parameters")
$mouseDeviceParameters = Get-ItemProperty $mouseDeviceParametersPath
$flipFlopWheel = $mouseDeviceParameters.FlipFlopWheel
if (($null -ne $flipFlopWheel) -And (0 -eq $flipFlopWheel)) {
$flipFlopWheel = 1
Set-ItemProperty $mouseDeviceParametersPath -Name "FlipFlopWheel" -Value $flipFlopWheel
$updatedMice += $mouse
}
}
if ($updatedMice.Count -gt 0) {
foreach ($mouse in $updatedMice) {
Write-Host "Disabling $(($mouse).FriendlyName)"
$mouse | Disable-PnpDevice -Confirm:$false
}
Start-Sleep -Seconds 5
foreach ($mouse in $updatedMice) {
Write-Host "Enabling $(($mouse).FriendlyName)"
$mouse | Enable-PnpDevice -Confirm:$false
}
}
@rbeesley
Copy link
Author

rbeesley commented Nov 8, 2021

Updated to be a little smarter about how it changes parameters. This will only disable and then reenable if the mouse setting needed to be updated. This should clean up some of the noise and provides a cleaner output when this is ran.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment