简体   繁体   English

匹配 AutoHotKey 中按下的两个 shift 键

[英]Match both shift keys being pressed in AutoHotKey

One of my keyboards has a larger Shift key where my pipe/backslash key normally is.我的一个键盘有一个更大的 Shift 键,我的管道/反斜杠键通常在那里。 Is there a way to match Shift-Shift in AutoHotKey (ie both Shift keys pressed) so that I can still type pipes ( | ) in the way I would with my other keyboards?有没有办法匹配 AutoHotKey 中的 Shift-Shift(即按下两个 Shift 键),以便我仍然可以像使用其他键盘一样输入管道 ( | )? I have tried simply ++ but that seems to equate to Shift-+ .我曾简单地尝试过++但这似乎等同于Shift-+

Thanks to @0x464e's comment, I was able to find the Virtual Key codes (VKs) for left shift and right shift by:感谢@0x464e 的评论,我能够通过以下方式找到左移和右移的虚拟键代码 (VK):

  1. Adding ++::Send {U+007C} to my ahk script (right of the :: is irrelevant here, this is just so that Shift shows up in the key history)++::Send {U+007C}到我的 ahk 脚本中( ::右侧在这里无关紧要,这只是为了让 Shift 显示在密钥历史记录中)
  2. Right click the script in the system tray, click Open, select Key History in the View tab.右键单击系统托盘中的脚本,单击打开,在视图选项卡中选择密钥历史记录。
  3. Type Shift-+ a few times with each Shift key into a text editor.使用每个 Shift 键在文本编辑器中键入Shift-+几次。
  4. Hit F5 in the Key History window and read off the values for Virtual Key for Left Shift and Right Shift ( VKA0 and VKA1 respectively in my case).在 Key History 窗口中按 F5 并读取左移和右移的虚拟键的值(在我的情况下分别为VKA0VKA1 )。

Then I added the following rules to my ahk script to send a pipe whenever I held the Right Shift key and pressed the Left Shift key:然后我将以下规则添加到我的 ahk 脚本中,以便在我按住右 Shift 键并按下左 Shift 键时发送管道:

VKA1 & VKA0::Send {U+007C}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM