problem using tab, alt-Tab, ctrl-Tab hotkey

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
Dorky
Posts: 18
Joined: 30 Mar 2021, 10:51

problem using tab, alt-Tab, ctrl-Tab hotkey

Post by Dorky » 25 Jan 2022, 00:24

I'm used to other languages, so I'm having doubts regarding how tf do i remap the TAB key...

It doesn't seem to work in any way I try for some reason, the key ignores AHK, or I'm using the hotkey wrong, or my ahk syntax sucks :x :x :x :x
I read it on ahk website but even following what they said, or when I used key names instead of symbols like !^ etc,
nothing worked either

wtf is wrong with this hotkeys script?

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

isTABHotkeyActivated = True


MsgBox, , , F1 --- ON-OFF APERTAR TAB PARA DAR ALT TAB `n`n`n`n #sep --- SEPARADOR DE TEXTO P USAR NO VS CODE, 2
::#sep:://==============================================================================

;;doesnt trigger at all
$Tab::
if (isTABHotkeyActivated = True) {
    send {AltTab}
} else {
    send {Tab}
}
Return




; i would use f1 here if this hotkey has problems
;F1::
;;doesnt trigger at all
Ctrl & Tab::
if (isTABHotkeyActivated = True) {
    MsgBox, , , Tab hotkey DESATIVADA!, 1
    isTABHotkeyActivated = False

} else if (isTABHotkeyActivated = false) {
    MsgBox, , , Tab hotkey ATIVADA!, 1
    ;MsgBox, , Title, Text, Timeout
    isTABHotkeyActivated = True

}
Return


Rohwedder
Posts: 7569
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: problem using tab, alt-Tab, ctrl-Tab hotkey

Post by Rohwedder » 25 Jan 2022, 02:17

Hallo,
only as a hint:
isTABHotkeyActivated = True and isTABHotkeyActivated = False
should be:
isTABHotkeyActivated := True and isTABHotkeyActivated := False!
More important is:
https://www.autohotkey.com/docs/Hotkeys.htm#alttab
AltTab and ShiftAltTab are two of the special commands that are only recognized when used on the same line as a hotkey.

Try something like that:

Code: Select all

^Tab::AltTabMenu
; Hotkey ^Tab toggles On/Off: AltTabMenu and Hotkeys Q and W
q::AltTab
w::ShiftAltTab

User avatar
Dorky
Posts: 18
Joined: 30 Mar 2021, 10:51

Re: problem using tab, alt-Tab, ctrl-Tab hotkey

Post by Dorky » 26 Jan 2022, 20:54

Rohwedder wrote:
25 Jan 2022, 02:17
Hallo,
only as a hint:
isTABHotkeyActivated = True and isTABHotkeyActivated = False
should be:
isTABHotkeyActivated := True and isTABHotkeyActivated := False!
More important is:
https://www.autohotkey.com/docs/Hotkeys.htm#alttab
AltTab and ShiftAltTab are two of the special commands that are only recognized when used on the same line as a hotkey.

Try something like that:

Code: Select all

^Tab::AltTabMenu
; Hotkey ^Tab toggles On/Off: AltTabMenu and Hotkeys Q and W
q::AltTab
w::ShiftAltTab
thanks ahk just has some weird rules sometimes

Post Reply

Return to “Ask for Help (v1)”