繁体   English   中英

如何输入(按住LButton)?

[英]How to input (Holding LButton)?

我试图使(按住左键1秒钟)使其右键单击。 这是我得到的:

 LButton::
    MouseClick, right, , , 1, 0, D
    Sleep 0
    MouseClick, right, , , 1, 0, U
return

如何将“ LButton”输入更改为“保持LButton 1秒钟”?

这个怎么样...

LButton::
StartTime := A_TickCount ; Set the timer
KeyWait, LButton ; Wait for release of mousebutton
ElapsedTime := A_TickCount - StartTime ; Calculate elapsed time
if (ElapsedTime > 1000)
    Click, Right ; when longer than 1000 ms
    Click, Left  ; when shorter than 1000 ms
return

缺点是您不能再使用鼠标来突出显示文本...

干得好:

#Persistent 
#SingleInstance Force
#NoEnv
SetBatchLines, -1

global timeDown = 0

SetTimer, checkLeftClick,25

checkLeftClick:
    if(  GetKeyState("LButton" , "P") )
    {
        timeDown += 25
    }
    else
    {
        timeDown = 0
    }

    if(timeDown > 1000)
    {
        MouseClick , left , , , , ,U
        Click,Right
        timeDown = 0
    }

return

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM