How can I disable Ctrl+Shift+W on Chrome for Windows 7
Solution 1:
You can use AutoHotkey to intercept the keyboard shortcut:
SetTitleMatchMode, Regex
#IfWinActive, (- Google Chrome)$
^+w::
;do nothing
return
#IfWinActive
Solution 2:
The answer by iglvzx doesn't work for newer versions of AutoHotKey (AHK). Here is how you can do it with newer AHK versions:
SetTitleMatchMode, Regex
#IfWinActive, ahk_class Chrome_WidgetWin_1
^+w::
;do nothing
return
^+q::
;do nothing
return
#IfWinActive
This also prevents Ctrl+Shift+Q from quitting all of Chrome.
Solution 3:
Complete version of this script. Works on new AHK versions.
- Works with any input language (assigned to key code, not key as letter)
- Only one running instance (SingleInstance force)
- Doesn't recording history of pressed keys (KeyHistory 0)
- Prevents from Ctrl+Shift+W and Ctrl+Shift+Q in Chrome
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. #SingleInstance force; #KeyHistory 0 ; SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. SetTitleMatchMode, Regex #IfWinActive, ahk_class Chrome_WidgetWin_1 ^+SC011:: ;do nothing return ^+SC010:: ;do nothing return #IfWinActive