自动热键3次=静音 [英] Autohotkey 3 clicks = volume mute

查看:119
本文介绍了自动热键3次=静音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在自动热键中,我试图使其延迟3次,按 +/- 10毫秒,它变为静音

In autohotkey im trying to make it so that when I press the left mouse button 3 times with a delay of +/- 10 ms it becomes a volume mute

LButton::
if (?) 
{
     Send, Volume_Mute
}
else 
{
     Send, LButton
}
Return

推荐答案

使用A_TickCount读取当前时间(以毫秒为单位),然后计算两次点击之间的延迟.请参见日期和时间

Use A_TickCount to read current time in milliseconds and then calculate the delay between clicks. See Date and Time

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

这篇关于自动热键3次=静音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆