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

时间:2018-11-08 11:55:24

标签: autohotkey

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

  

错误“〜”不是有效的键名

#Persistent
#SingleInstance force

DetectHiddenWindows, On
SetTitleMatchMode 2


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

WhickKey:
  MsgBox %A_ThisHotkey%
Return

1 个答案:

答案 0 :(得分:2)

必须将双引号括起来以将其与变量区分开来。

#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