本文介绍了如何才能使按键的输出依赖于按下的持续时间。(在AKK中,自动热键)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
基本上我想要的是F9键在按下500ms以下时转换为Ctrl+W,并在任何超过500ms的时间内转换为Esc键。THX
推荐答案
$F9::
Keywait, F9, T0.5 ; waits 0.5 seconds maximally for F9 to be released
if ErrorLevel ; pressed for above that time
Send ^w
else
Send {Esc}
Return
或
$F9::
Keywait, F9, T0.5 ; waits 0.5 seconds maximally for F9 to be released
if ErrorLevel ; pressed for above that time
{
KeyWait, F9 ; wait for F9 to be released
Send ^w
}
else
Send {Esc}
Return
https://www.autohotkey.com/docs/commands/KeyWait.htm
这篇关于如何才能使按键的输出依赖于按下的持续时间。(在AKK中,自动热键)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!