Send tab only if released without pressing another key?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
TheNomadicAspie
Posts: 140
Joined: 07 Jan 2020, 15:39

Send tab only if released without pressing another key?

24 Jul 2021, 11:00

I'm trying to use Tab + other keys as hotkeys only when a certain program is active/in focus. As is my script works, but completely disabled the tab key so I'm unable to use it to tab around. It also works all the time instead of only when the program is active, and my if statement is returning an error, AHK says the line will never be reached. What am I doing wrong here?

Code: Select all

if WinActive ahk_exe qutebrowser.exe
Tab & p::
SendRaw, :tab-prev
Send {Enter}
Return

Tab & n::
SendRaw, :tab-next
Send {Enter}
Return

Tab & t::
SendRaw, :tab-clone
Send {Enter}
Return

Tab & s::
SendRaw, :tab-give
Send {Enter}
Return

Tab & c::
SendRaw, :tab-close
Send {Enter}
Return

Tab & i:: ;Isolate
SendRaw, :tab-only
Send {Enter}
Return

Tab & b::
SendRaw, :back
Send {Enter}
Return

Tab & f::
SendRaw, :forward
Send {Enter}
Return

Tab & h::
SendRaw, :home
Send {Enter}
Return

Tab & r::
SendRaw, :reload
Send {Enter}
Return

Tab & u::
SendRaw, :undo
Send {Enter}
Return

Tab & Up::
SendRaw, :zoom-in
Send {Enter}
Return

Tab & Down::
SendRaw, :zoom-out
Send {Enter}
Return

Tab & x::
SendRaw, :close
Send {Enter}
Return

Tab & d::
SendRaw, :download
Send {Enter}
Return

Tab & a:: ;All space
SendRaw, :fullscreen
Send {Enter}
Return

Tab & /::
SendRaw, :search 
Send {Space}
Return
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: Send tab only if released without pressing another key?

24 Jul 2021, 17:17

Code: Select all

if WinActive ahk_exe qutebrowser.exe
should have been

Code: Select all

#ifWinActive ahk_exe qutebrowser.exe
or

Code: Select all

#if WinActive("ahk_exe qutebrowser.exe")
TheNomadicAspie
Posts: 140
Joined: 07 Jan 2020, 15:39

Re: Send tab only if released without pressing another key?

24 Jul 2021, 23:47

Thank you, that was the problem. I appreciate the help.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Chunjee, Google [Bot] and 246 guests