按住鼠标右键后检测 F 键按下
Detect F key press after holding right mouse button
我正在尝试编写一个脚本来检测 Right Mouse Click
被按住至少 1.5 秒,然后在 Right Mouse Click
仍然被按住时按下 F
键。
我尝试了以下方法:
Loop
{
Send, {F Down}
Sleep 2000
Send, {F Up}
sleep 1500
}
return
^F::Pause
我意识到这只是一个计时器,并没有检测到按下了哪些键。如何编写实现上述功能的脚本?
loop
{
Key := GetKeyState("rbutton")
while(Key = 0)
{
Key := GetKeyState("rbutton")
sleep,100
}
while(Key = 1)
{
sleep,100
loopnmb := A_Index
if(loopnmb = 8) ;;this number changes the length rbutton has to be pressed before F key activates
{
Key := GetKeyState("rbutton")
while(Key = 1)
{
Send, {F Down}
Key := GetKeyState("rbutton")
if(Key = 0)
{
Send, {F Up}
break
}
}
}
}
}
计时器有点不对劲,请尝试一下。
我正在尝试编写一个脚本来检测 Right Mouse Click
被按住至少 1.5 秒,然后在 Right Mouse Click
仍然被按住时按下 F
键。
我尝试了以下方法:
Loop
{
Send, {F Down}
Sleep 2000
Send, {F Up}
sleep 1500
}
return
^F::Pause
我意识到这只是一个计时器,并没有检测到按下了哪些键。如何编写实现上述功能的脚本?
loop
{
Key := GetKeyState("rbutton")
while(Key = 0)
{
Key := GetKeyState("rbutton")
sleep,100
}
while(Key = 1)
{
sleep,100
loopnmb := A_Index
if(loopnmb = 8) ;;this number changes the length rbutton has to be pressed before F key activates
{
Key := GetKeyState("rbutton")
while(Key = 1)
{
Send, {F Down}
Key := GetKeyState("rbutton")
if(Key = 0)
{
Send, {F Up}
break
}
}
}
}
}
计时器有点不对劲,请尝试一下。