1

右クリックするように(左ボタンを1秒間押し続けて)作成しようとしています。これが私が得たものです:

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

「LButton」入力を「LButtonを1秒間保持」に変更するにはどうすればよいですか?

4

2 に答える 2

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

欠点は、たとえばテキストを強調表示するためにマウスを使用できなくなることです...

于 2013-01-08T18:29:25.743 に答える
0

どうぞ:

#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
于 2013-01-08T20:50:38.233 に答える