拜托,你能解释一下这个简单的AHK脚本吗?

时间:2017-08-09 21:05:00

标签: autohotkey

我修改了一个简单的旧AHK脚本,它基本上变成了一个"。" (点)键按下":" (冒号)作为输出。

问题是我需要映射两个键盘点(numpad one和右Alt键附近的一个)。好吧,我有点通过试验猜测如何修改代码并且它有效但我想了解原因和方法!

我觉得近年来AHK文档有了很大的改进,但我无法找到解决问题的方法。以下是我希望您解释的代码(我的麻烦主要是了解最后一行及其与之前行的关联):

SC034::
NumPadDot:::
:::NumPadDot::SC034

请尽可能提供AHK官方文档的链接,非常感谢! 谢谢

1 个答案:

答案 0 :(得分:1)

SC034::              ; Label for scancode 34 ("."). Since there's no definition
                     ; on this line it's grouped with the next definition
NumPadDot:: :        ; NumPadDot and SC34 will map to ":"
:::NumPadDot::SC034  ; defines a hotstring that outputs "SC034" when you type ":NumPadDot"