Added option to disable the Sticky Keys keyboard shortcut

This commit is contained in:
Raphire
2025-04-16 12:56:37 +02:00
parent e53709653d
commit 224b0d7705
7 changed files with 35 additions and 1 deletions

View File

@@ -37,6 +37,7 @@ param (
[switch]$ClearStartAllUsers,
[switch]$RevertContextMenu,
[switch]$DisableMouseAcceleration,
[switch]$DisableStickyKeys,
[switch]$HideHome,
[switch]$HideGallery,
[switch]$ExplorerToHome,
@@ -560,7 +561,11 @@ function RestartExplorer {
Write-Output "> Restarting Windows Explorer process to apply all changes... (This may cause some flickering)"
if ($global:Params.ContainsKey("DisableMouseAcceleration")) {
Write-Host "Warning: The Enhance Pointer Precision setting has been changed, this setting will only take effect after a reboot" -ForegroundColor Yellow
Write-Host "Warning: The Enhance Pointer Precision setting changes will only take effect after a reboot" -ForegroundColor Yellow
}
if ($global:Params.ContainsKey("DisableStickyKeys")) {
Write-Host "Warning: The Sticky Keys setting changes will only take effect after a reboot" -ForegroundColor Yellow
}
# Only restart if the powershell process matches the OS architecture.
@@ -843,6 +848,15 @@ function DisplayCustomModeOptions {
AddParameter 'DisableMouseAcceleration' 'Turn off Enhance Pointer Precision (mouse acceleration)'
}
# Only show this option for Windows 11 users running build 26100 or later
if ($WinVersion -ge 26100){
Write-Output ""
if ($( Read-Host -Prompt "Disable the Sticky Keys keyboard shortcut? (y/n)" ) -eq 'y') {
AddParameter 'DisableStickyKeys' 'Disable the Sticky Keys keyboard shortcut'
}
}
# Only show option for disabling context menu items for Windows 10 users or if the user opted to restore the Windows 10 context menu
if ((get-ciminstance -query "select caption from win32_operatingsystem where caption like '%Windows 10%'") -or $global:Params.ContainsKey('RevertContextMenu')){
Write-Output ""
@@ -1460,6 +1474,10 @@ else {
RegImport "> Turning off Enhanced Pointer Precision..." "Disable_Enhance_Pointer_Precision.reg"
continue
}
'DisableStickyKeys' {
RegImport "> Disabling the Sticky Keys keyboard shortcut..." "Disable_Sticky_Keys_Shortcut.reg"
continue
}
'ClearStart' {
Write-Output "> Removing all pinned apps from the start menu for user $(GetUserName)..."
ReplaceStartMenu