在 Autohotkey 中使用虚拟键盘代码时遇到问题

Having problem with using Virtual keyboard code in Autohot Key

根据我在 previous question 中解释的错误,事实证明我应该为遇到错误的键使用虚拟键盘代码。

我想为热键 +'(同时按下 Shift 和 ')和键使用虚拟代码; (半列)(更具体地说,我想使用热键 +' 来点击坐标和键 ; 点击其他坐标)但是我在编写代码时遇到了问题。我找到了虚拟键列表 here 但不幸的是我不知道如何使用它们来编写代码。

编辑:

对于按半列 (;) 我试过这个键:

[vkBA27]::
Click,885,234
return

但是它说它是无效的热键。

来自AutoHotkey documentation

If your keyboard or mouse has a key not listed above, you might still be able to make it a hotkey by using the following steps:

  1. Ensure that at least one script is running that is using the keyboard hook. You can tell if a script has the keyboard hook by opening its main window and selecting "View->Key history" from the menu bar.
  2. Double-click that script's tray icon to open its main window.
  3. Press one of the "mystery keys" on your keyboard.
  4. Select the menu item "View->Key history"
  5. Scroll down to the bottom of the page. Somewhere near the bottom are the key-down and key-up events for your key. NOTE: Some keys do not generate events and thus will not be visible here. If this is the case, you cannot directly make that particular key a hotkey because your keyboard driver or hardware handles it at a level too low for AutoHotkey to access. For possible solutions, see further below.
  6. If your key is detectable, make a note of the 3-digit hexadecimal value in the second column of the list (e.g. 159).
  7. To define this key as a hotkey, follow this example:
SC159:: ; Replace 159 with your key's value.
MsgBox, %A_ThisHotkey% was pressed.
return

解读上面的例子,我们知道使用虚拟键的热键声明的格式是:

SC<Hex code>::
<Your code here>
Return

我只能假设“SC”代表“扫描码”。使用上面的步骤,我可以看到 ; 的扫描码(文档将其称为“3 位十六进制值”)是 027,并且扫描' 的代码是 028。这使我可以像这样构建您的热键定义:

SC027::
<Your code for ; here>

+SC028::
<Your code for SHIFT+' here>