disable ctrl+W on chrome for specific tabs

Get help with using AutoHotkey and its commands and hotkeys
partof
Posts: 110
Joined: 16 Jan 2016, 08:38

disable ctrl+W on chrome for specific tabs

05 Nov 2017, 17:21

hi!
I wanted ahk to disable ctrl+w on pinned tab but that doesn't seem to be possible so instead, I want to disable ctrl+W on a specific tab name ("test")

This code doesn't work, any advice would be really appreciated

Code: Select all

SetTitleMatchMode, Regex

#IfWinActive, ahk_class Chrome_WidgetWin_1 and WindowTitle contains test

		^w::
			;do nothing
			return
		^q::
			;do nothing
			return

#IfWinActive
GEV
Posts: 893
Joined: 25 Feb 2014, 00:50

Re: disable ctrl+W on chrome for specific tabs

05 Nov 2017, 17:32

Code: Select all

SetTitleMatchMode, Regex    ; or SetTitleMatchMode, 2

#If WinActive("test ahk_class Chrome_WidgetWin_1")

	^w::
	^q::
	return   ; do nothing
	
#If
partof
Posts: 110
Joined: 16 Jan 2016, 08:38

Re: disable ctrl+W on chrome for specific tabs

06 Nov 2017, 02:09

excellent, thanks a lot!

Here is the code to disable ctrl+w for the tab named test1 and test2

Code: Select all

SetTitleMatchMode, Regex

#If WinActive("test1 ahk_class Chrome_WidgetWin_1") || WinActive("test2 ahk_class Chrome_WidgetWin_1") 
		^w::
		^q::
			return  ; do nothing

#IfWinActive

Return to “Ask For Help”

Who is online

Users browsing this forum: ahk7, Bing [Bot], busterwolf, f c, Google [Bot], sanmaodo, xavier and 66 guests