错误“~”不是有效的键名(AutoHotkey 1.1.30.00)

Error "~" is not a valid key name (AutoHotkey 1.1.30.00)

这是我的旧源代码,新版本的 AutoHotkey 中没有 运行。 请修复此代码。

Error "~" is not a valid key name

#Persistent
#SingleInstance force

DetectHiddenWindows, On
SetTitleMatchMode 2


Loop, 0x7f
Hotkey, % "*~". chr(A_Index), WhickKey
Return

WhickKey:
  MsgBox %A_ThisHotkey%
Return

文字字符串必须用双引号引起来以区别于变量。

#Persistent
#SingleInstance force

DetectHiddenWindows, On
SetTitleMatchMode 2


Loop, 0x7f
Hotkey, % ""*~"" . chr(A_Index), WhickKey
Return

WhickKey:
  MsgBox %A_ThisHotkey%
Return

https://autohotkey.com/docs/Variables.htm#Expressions