"$" in the shortcut is failing

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
primes2357
Posts: 1
Joined: 14 Jun 2021, 19:12

"$" in the shortcut is failing

14 Jun 2021, 19:21

Hi everyone, I have a question that has been driving me crazy for hours and I can't find anything on teh googles about it.

I need something like this to work:

Code: Select all

$Alt & w::Send ^w
I feel like this should be super simple, but having the $ before the shortcut throws an AHK error when reloading the script, no matter how I try to rejigger the shortcut/hotkey side of the code (e.g. {$Alt}, ${Alt}, etc). Interestingly, if I only do $Alt as the shortcut, and omit the w, it works fine.

Note 1: I am unable to simply use "!w::Send ^w" because the "alt" keypress will trigger the program (menu?) for one of the major apps I use, such that it closes the entire thing when I press Alt-W, rather than just the active window. Based on my testing, it seems I need the $ as well as Alt or LAlt for it to work correctly.

Note 2: "$Alt" on the shortcut/left side, by itself, works just fine--but in combo with the "w" key, it fails.
I'd appreciate any tips or advice
User avatar
mikeyww
Posts: 27044
Joined: 09 Sep 2014, 18:38

Re: "$" in the shortcut is failing

14 Jun 2021, 20:09

Unfortunately, Alt is problematic in many instances.
Custom combinations involving keyboard keys always use the keyboard hook, as do any hotkeys which use the prefix key as a suffix. For example, a & b:: causes ^a:: to always use the hook.
WinClose is useful for closing windows, too.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Tvlao and 336 guests