autohotkey - 如何使按键的输出取决于按键的持续时间。(在 ahk,自动热键)
问题描述
基本上我想要的是 F9 键在按下 500 毫秒以下时转换为 Ctrl + W 并在任何时间超过 500 毫秒时转换为 Esc 。谢谢
解决方案
$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
推荐阅读
- asp.net - 这个错误的原因是什么 System.ArgumentException
- visual-studio - 是否有适用于 Visual Studio 2017 的智能 tpl 代码格式化程序?
- javascript - 将 php 的自动递增循环变量值传递给 jquery/javascript
- apache-camel - Camel + pollEnrich from bean
- r - 将 dplyr 子表检测为函数而不是表
- robotframework - RobotFrameWork:如何检查组件块顶行中的动态元素
- azure - 没有 /FileStore 和 /Users 的 Azure Databricks
- hibernate - Hibernate 在 logback 中显示没有时间戳格式的 sql 日志
- maven - 找不到 com.android.support:appcompat-v7:28.0.0
- css - 页脚和页眉重叠内容