autohotkey - 自动热键 3 次点击 = 静音
问题描述
在自动热键中,我试图做到这一点,以便当我按鼠标左键 3 次并延迟+/- 10 毫秒时,它会变成音量静音
LButton::
if (?)
{
Send, Volume_Mute
}
else
{
Send, LButton
}
Return
解决方案
用于A_TickCount
以毫秒为单位读取当前时间,然后计算点击之间的延迟。查看日期和时间
ms := A_TickCount
N := 3 ; number of clicks
T := 500 ; max delay between clicks, ms
clicks := 0
~lbutton::
msx := A_TickCount ; get current time
d := msx - ms ; get time past
ms := msx ; remember current time
if (d < T)
clicks += 1
else
clicks := 1
if (clicks >= N)
{
; tooltip %N%-click detected
send {Volume_Mute}
clicks := 0
}
return
推荐阅读
- javascript - 单击内部 div 时获取父 div id 名称
- java - JDK14-SpringBoot-Maven-Cassandra:“无法初始化类 org.codehaus.groovy.vmplugin.v7.Java7”异常仅具有 Cassandra 依赖项
- oauth-2.0 - 在 Microsoft OIDC 授权中跳过离线访问权限
- php - 找不到类“App\Libraries\QRcode” - 使用 CodeIgniter-PHP-QR-Code Codeigniter 4
- c# - 我用于 AES 加密 C# 的密钥大小错误
- java - hibernate 验证器抛出异常 ValidationException: HV000028 for @Past annotation
- python - Jinja2.exceptions.TemplateSyntaxError:遇到未知标签“信息”
- machine-learning - 使用 Pytorch 预测舞蹈帧
- r - 如何使用 R 中的文本函数将方程添加到我的绘图中?
- json - 如何以模块化形式在 Terraform 中使用 s3 生命周期规则,即在单独的 JSON 中引用?