unable to disable hotkeys for separate sites?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
milkygirl90
Posts: 565
Joined: 10 Nov 2020, 21:22

unable to disable hotkeys for separate sites?

16 Jun 2021, 01:47

code as per below. I tried changing the sequence too but the # Space is still in effect.

Code: Select all

#If WinActive("ahk_group MyBrowsers") ;ALL BROWSERS HERE
Capslock::
SendInput #{Space}
return

#IfWinActive Reddit Submit ahk_group MyBrowsers
::Capslock::Capslock
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: unable to disable hotkeys for separate sites?

16 Jun 2021, 03:35

i dont see anything wrong with the code
User avatar
milkygirl90
Posts: 565
Joined: 10 Nov 2020, 21:22

Re: unable to disable hotkeys for separate sites?

17 Jun 2021, 00:27

it's not disabled on reddit though..
gregster
Posts: 8989
Joined: 30 Sep 2013, 06:48

Re: unable to disable hotkeys for separate sites?

17 Jun 2021, 02:04

::Capslock::Capslock is a auto-replace hotstring, not a hotkey - and it replaces the string Capslock with the string Capslock... :think:

I guess, disbling Capslock should look more like this:

Code: Select all

Capslock::return
Haven't tested, but you also might want to put it above the more general hotkey variant, so that it takes priority, if the Reddit condition is true.

Code: Select all

#IfWinActive Reddit Submit ahk_group MyBrowsers
Capslock::return

#If WinActive("ahk_group MyBrowsers") ;ALL BROWSERS HERE
Capslock::
SendInput #{Space}
return
(Docs: "If more than one variant is eligible to fire, only the one closest to the top of the script will fire.")
Last edited by gregster on 17 Jun 2021, 02:08, edited 1 time in total.
User avatar
milkygirl90
Posts: 565
Joined: 10 Nov 2020, 21:22

Re: unable to disable hotkeys for separate sites?

17 Jun 2021, 02:14

gregster wrote:
17 Jun 2021, 02:04
::Capslock::Capslock is a auto-replace hotstring, not a hotkey - and it replaces the string Capslock with the string Capslock... :think:

I guess, disbling Capslock should look more like this:

Code: Select all

Capslock::return
Haven't tested, but you also might want to put it above the more general hotkey variant, so that it takes priority, if the Reddit condition is true.

Code: Select all

#IfWinActive Reddit Submit ahk_group MyBrowsers
Capslock::return

#If WinActive("ahk_group MyBrowsers") ;ALL BROWSERS HERE
Capslock::
SendInput #{Space}
return
(Docs: "If more than one variant is eligible to fire, only the one closest to the top of the script will fire.")
sorry.. what I meant is to disable the Capslock::Win+Space combo when I'm on reddit, not to disable the capslock functionality itself.
gregster
Posts: 8989
Joined: 30 Sep 2013, 06:48

Re: unable to disable hotkeys for separate sites?

17 Jun 2021, 02:17

Perhaps just:

Code: Select all

#If WinActive("ahk_group MyBrowsers") && !WinActive("Reddit Submit")	;ALL BROWSERS HERE
Capslock::
SendInput #{Space}
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: haomingchen1998, ReyAHK and 250 guests