Switching between last two opened windows Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
becritical
Posts: 21
Joined: 23 May 2016, 03:28

Switching between last two opened windows

27 May 2024, 05:03

Howdy,

I am using this code to switch between the last two opened windows

Code: Select all

`:: Send "{LAlt down}{Tab}{LAlt up}"
But then I am transition to V2 and noticed the AltTab hotkey, however it doesn't work

Code: Select all

`:: AltTab 
does not produce any effect. I have read the AltTab documentation but it's not clear if it can be used for my purpose or just to cycle through the AltTab menu.

Thanks in advance for any feedback!
User avatar
xMaxrayx
Posts: 237
Joined: 06 Dec 2022, 02:56
Contact:

Re: Switching between last two opened windows  Topic is solved

27 May 2024, 05:24

AltTab only works with two keys combination i guess unless if that key was non-letters

Code: Select all

#Requires AutoHotkey v2.0


l::SendInput("!{Tab}")

$`:: SendInput "{Alt down}{Tab Down}{Tab up}{Alt up}"

f::SendInput("{Alt down}{Tab Down}{Tab up}{Alt up}")


a & g::AltTab ;only works with tow comb



Last edited by xMaxrayx on 27 May 2024, 05:28, edited 1 time in total.
-----------------------ヾ(•ω•`)o------------------------------
https://github.com/xmaxrayx/
becritical
Posts: 21
Joined: 23 May 2016, 03:28

Re: Switching between last two opened windows

27 May 2024, 05:26

xMaxrayx wrote:
27 May 2024, 05:24

Code: Select all

#Requires AutoHotkey v2.0


l::SendInput("!{Tab}")

$`:: SendInput "{Alt down}{Tab Down}{Tab up}{Alt up}"

f::SendInput("{Alt down}{Tab Down}{Tab up}{Alt up}")


a & g::AltTab ;only works with tow comb



Thanks a lot for the quick reply! Which codes of the one you posted is more efficient? Is it more efficient in general to use hotkeys such as "!" "^" or to send the down/up combos?
User avatar
xMaxrayx
Posts: 237
Joined: 06 Dec 2022, 02:56
Contact:

Re: Switching between last two opened windows

27 May 2024, 05:30

I prefer SendInput("{Alt down}{Tab Down}{Tab up}{Alt up}") since it's mimic keyboard physic input and you have more freedom like if you want set the a keystatus to down before other keys but i'm not expert.

the !#^ are more useful as hotkey #R::msgbox but not with send("!tap) but it's faster to write, becouse you can write like this ^+L::msgbox but with name keys only allowed tow LShift & L :: msgbox.

also some behavior changed from 1v to v2
Hotkeys now mask the Win/Alt key on release only if it is logically down and the hotkey requires the Win/Alt key (with #/! or a custom prefix). That is, hotkeys which do not require the Win/Alt key no longer mask Win/Alt-up when the Win/Alt key is physically down. This allows hotkeys which send {Blind}{LWin up} to activate the Start menu (which was already possible if using a remapped key such as AppsKey::RWin).
-----------------------ヾ(•ω•`)o------------------------------
https://github.com/xmaxrayx/

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: RussF, Smile_, songdg, Vanda_a, WarlordAkamu67 and 32 guests