forked from ChrisTitusTech/winutil
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
convert mouse acceleration checkboxs into togglebutton
- Loading branch information
1 parent
9fd3a9d
commit 1953289
Showing
6 changed files
with
124 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
Function Invoke-WinUtilMouseAcceleration { | ||
<# | ||
.SYNOPSIS | ||
Enables/Disables Mouse Acceleration | ||
.PARAMETER DarkMoveEnabled | ||
Indicates the current Mouse Acceleration State | ||
#> | ||
Param($MouseAccelerationEnabled) | ||
Try{ | ||
if ($MouseAccelerationEnabled -eq $false){ | ||
Write-Host "Enabling Mouse Acceleration" | ||
$MouseSpeed = 1 | ||
$MouseThreshold1 = 6 | ||
$MouseThreshold2 = 10 | ||
} | ||
else { | ||
Write-Host "Disabling Mouse Acceleration" | ||
$MouseSpeed = 0 | ||
$MouseThreshold1 = 0 | ||
$MouseThreshold2 = 0 | ||
|
||
} | ||
|
||
$Path = "HKCU:\Control Panel\Mouse" | ||
Set-ItemProperty -Path $Path -Name MouseSpeed -Value $MouseSpeed | ||
Set-ItemProperty -Path $Path -Name MouseThreshold1 -Value $MouseThreshold1 | ||
Set-ItemProperty -Path $Path -Name MouseThreshold2 -Value $MouseThreshold2 | ||
} | ||
Catch [System.Security.SecurityException] { | ||
Write-Warning "Unable to set $Path\$Name to $Value due to a Security Exception" | ||
} | ||
Catch [System.Management.Automation.ItemNotFoundException] { | ||
Write-Warning $psitem.Exception.ErrorRecord | ||
} | ||
Catch{ | ||
Write-Warning "Unable to set $Name due to unhandled exception" | ||
Write-Warning $psitem.Exception.StackTrace | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters