2015-09-07 44 views
2

我有这个小AutoHotkey的脚本做的东西,而移动和左击压或右击按下

LoopFunc() 
{ 
    while (GetKeyState("shift") && GetKeyState("lbutton")) || GetKeyState("rbutton") 
    { 
     send, {4} 
     sleep, 500 
    } 
} 

~rbutton::LoopFunc() 

~+lbutton::LoopFunc() 

RButton作品如预期,但 + LButton只有两次循环。

任何想法为什么?

编辑:

我将此添加到我的while循环

n := GetKeyState("shift", "p") 
m := GetKeyState("lbutton") 
tooltip, %n% %m% 

首先提示是1 1,第二个提示是0 1

回答

1

使用"p" parameter得到实际P上的按钮物质环境的状态,并为use & LSHIFT +LButton

LoopFunc() 
{ 
    while (GetKeyState("shift", "p") && GetKeyState("lbutton", "p")) || GetKeyState("rbutton") 
    { 
    send, {4} 
    sleep, 500 
    } 
} 

~rbutton::LoopFunc() 

~lshift & lbutton::LoopFunc() 
+0

更新代码的工作就像一个魅力。谢谢。 –

相关问题