右クリックするように(左ボタンを1秒間押し続けて)作成しようとしています。これが私が得たものです:
LButton::
MouseClick, right, , , 1, 0, D
Sleep 0
MouseClick, right, , , 1, 0, U
return
「LButton」入力を「LButtonを1秒間保持」に変更するにはどうすればよいですか?
右クリックするように(左ボタンを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