How to exclude custom buttons on some browser pages. Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
d_romeo
Posts: 30
Joined: 23 Dec 2020, 12:18

How to exclude custom buttons on some browser pages.

06 Mar 2022, 09:59

Hi, I would like to exclude, or override, some hotkeys in some pages, especially in PDF pages or browser extensions, for example:

Code: Select all

#IfWinActive, ahk_exe msedge.exe 
    ^f::^!l
    ^m::^f
    !up::^+u
#IfWinActive
I'd like to "reset" Ctrl+F when in pdf or CSS style editor, for which I tried

Code: Select all

SetTitleMatchMode, 2
#IfWinActive, Stylus 
	;nuovi tasti
#IfWinActive	
on a title page: "nameStyle - Stylus ", without success.
Can you tell me what I'm doing wrong?
Thank you.
Last edited by d_romeo on 07 Mar 2022, 07:46, edited 1 time in total.
User avatar
mikeyww
Posts: 27362
Joined: 09 Sep 2014, 18:38

Re: How to exclude radio buttons on some browser pages.

06 Mar 2022, 10:59

Here is a general approach, though it might not apply to a CSS inspection panel.

Code: Select all

SetTitleMatchMode, 2

browser = msedge
exclude = Stylus

#If WinActive("ahk_exe" browser ".exe") && !WinActive(exclude)
^f::MsgBox, Test
#If
d_romeo
Posts: 30
Joined: 23 Dec 2020, 12:18

Re: How to exclude custom buttons on some browser pages.

07 Mar 2022, 10:29

Thank you, it works, but what if I want to add multiple windows? I tried adding a second name, separated by both comma, and || to no avail.
For PDF's I was thinking of looking for a script to get the URL of the web page, given ".pdf" seems to have no effect.
User avatar
mikeyww
Posts: 27362
Joined: 09 Sep 2014, 18:38

Re: How to exclude custom buttons on some browser pages.  Topic is solved

07 Mar 2022, 10:52

Code: Select all

#If WinActive("ahk_exe" browser ".exe") && !WinActive(exclude) && !WinActive(".pdf")
Or:

Code: Select all

SetTitleMatchMode, 2

GroupAdd, browser, ahk_exe msedge.exe
GroupAdd, exclude, Stylus
GroupAdd, exclude, .pdf

#If WinActive("ahk_group browser") && !WinActive("ahk_group exclude")
^f::MsgBox, Test
#If
d_romeo
Posts: 30
Joined: 23 Dec 2020, 12:18

Re: How to exclude custom buttons on some browser pages.

08 Mar 2022, 09:40

It works perfectly, thank you!!!!

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: balawi28, Bing [Bot], Google [Bot], mikeyww, peter_ahk, Rostov and 124 guests