目的就是按下鼠标任何键,都可以设置热键,比如在资源管理中输入内容查找文件,并不知道会按下什么键,但是需要按下任意键都要能弹出输入窗口。

这个时候这个代码就有用处。

代码记录如下:

?

k_ASCII = 45
Loop
{
    Transform, k_char, Chr, %k_ASCII%
    StringUpper, k_char, k_char
    if k_char not in <,>,^,~,,`,
        Hotkey, ~*%k_char%, k_KeyPress
        ; In the above, the asterisk prefix allows the key to be detected regardless
        ; of whether the user is holding down modifier keys such as Control and Shift.
    if k_ASCII = 93
        break
    k_ASCII++
}

k_KeyPress:
;这里就是输入任意键激活后需要运行的代码。

?