I am new to this community and hope I am posting in the right location. I am a big fan of AHK, but am stuck with this issue:
The following script is meant to exit a program that appears as an icon in the taskbar (access through Win+b):
```
Code: Select all
!b::
send #b
send {right}
send {AppsKey};
send {up}
send {enter}
Return
It's a bit hacky, but the idea is to open the context-menu using the `{AppsKey}` mapping and then choose the last item on the pop-up menu (which is "Exit") and hit enter. The problem is that send {AppsKey} does *not* behave exactly like the context-menu key, because it loses the keyboard focus (the next commnd, `send {up}` does nothing. When I try to do this "manually" (that is, pressing Win+b, then right arrow, then context-menu button) -- the focus remains and the next command -- arrow up -- works fine.
Thanks in advance for any help.
Gil