无论语言如何,重新映射键

Remap keys regardless of language

我想将 'H' 重新映射到 'V',而且当我输入阿拉伯语时,我想将“ا”重新映射到“б”,即“ا”和“б”分别与 'H' 和 'V' 位于相同的键中。所以我尝试做 h:: send v;。当我用英语输入时,一切都很完美,但在阿拉伯语中,它实际上输入的是 'v' 而不是 'б'。

注意:我目前正在检查语言并以适当的语言发送击键,但我正在重新映射很多键,所以有点乏味,我认为必须有更简单的方法,有没有更简单的方法方式?

提前致谢。

当您执行 Send v 时,AutoHotkey 会发送一个 v 字符。但是,您不想要该字符,而是希望它按下英文键盘上的 v 键。您可以使用虚拟键码来执行此操作。虚拟键码背后的想法是每个代码对应于键盘上的一个物理键,而不是屏幕上产生的字符。有两种实现方法。

  1. AutoHotkey special syntax 可以找到并使用给定字符的虚拟键码。您只需将字符括在大括号中,如下所示:
h::Send {v}
  1. AutoHotkey 自带 tools that can be used to manually find the virtual key code for a certain key. This is useful if the key you need to press doesn't map to any character, or if AutoHotkey doesn't recognize the character it produces. The process below is quoted from the AutoHotkey documentation:
  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.

记下列表第一列中的两位数值。 V 在我的 Windows 10 机器上是 56,但数字取决于平台。然后,您可以在发送命令中使用该 2 位虚拟键码,如下所示:

h::Send {vk56}

此语法已记录 here