My workflow is:

  • While working with the laptop keyboard, no changes needed
  • While at the desk with ext monitor, use Apple external keyboard. Run AutoHotKey script to swap LWinwith LAlt. Kill AHK process when back to laptop keyboard.

Following script used on a windows 10 machine.

LWin & Tab::AltTab                     
LWin::Send {LAlt}                      
LAlt::Send {LWin}                      

On running the script following issues occur. I am using all lowercase to refer to the physical keys (e.g. lwin) and ahk code for the semantic of a key press (e.g. LWin).

Problem 1

If the active window is Task Manager

Should: lalt produces LWin, lwin produces LAlt

Behaves: lalt produces LAlt. lwin produces LWin first time (shows start menu) however when pressed second time start menu is not hidden, although that is what LWin is supposed to do.

Problem 2

lctrl+lalt+tab does not produce the desired effect, it works like LAlt+Tab

Should: window switcher should stay open after key release

Behaves: windows switcher selects app and closes after key release

Problem 3

lalt+tab does not produce LWin+Tab

Should: show virtual desktops

Behaves: opens start menu with a wicked selection on the Expand button (top-left corner of start menu)

How can the script be improved to mitigate the problems?

  • If I remember correctly, there's also a section in the documentation that specifically addresses Alt+Tab known issues? Here's the page, though it's been a while since I've read it myself. – Arctiic Nov 2 '19 at 21:11

Maybe I'm not understanding the nuances of your post... why are you doing key substution for the first hotkey but not for the second two?

LWin & Tab::AltTab                     

If you do actually need to send keys instead of doing key substitution, you may also need to look at handling and/or substituting the 'Up' events, if they are not being handled correctly, and sending {<Key> Down} and {<Key> Up} instead of just sending <whatever key>, which will do a <key> down/up.

If you want to see the effects of your current script, look at the Key History (open the program from the tray menu and go to Key History from the menu), where you will probably see it sending <key> up events when you don't want them to occur, i.e., as soon as you press the <key> it will send a <down> event and an <up> event instead of waiting to send the event when you actually let off the <key>.

  • That was a configuration that I tried previously and the problems described in the original post still occur – iovuio Nov 9 '19 at 21:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.