0

Windowsエクスプローラーで、次のことをしたい:

マウスの右ボタンを押したままにする: オートホットキー マウスの左クリックを待つ アクションの実行

Mouse-Right (通常の右クリック)を押して放すと、通常の Windows コンテキスト メニューを実行します。

問題は、マウスボタンのキーステートにあります。私はそれを理解することはできません。誰かがこれに似たスクリプトをすでに持っているかもしれません。

#IfWinActive ahk_class CabinetWClass
RButton::
Loop
{
   GetKeyState, state, RButton
   if state = D
     KeyWait, LButton, D
     send {Del}
   if state = U
     return
  }
 Click right
return

これが私が思いついたものです。動作していません:((

4

2 に答える 2

1

この問題にはもう少し良い解決策があると思います。私の意見では、それは短くてきれいです:

#IfWinActive ahk_class CabinetWClass

RButton & LButton::
    Send {Del} ;or do whatever you want
return

RButton::
    Send, {RButton}
return

編集:

2年半後にこの回答を振り返ってみると、ファイルの右クリックによるドラッグがおそらく妨げられることに気付いたので、これはより良い代替手段になる可能性がありますが、テストしていません:

#IfWinActive ahk_class CabinetWClass

~RButton & ~LButton::
    Send {Del} ;or do whatever you want
return
于 2015-03-24T22:30:24.220 に答える
1

それが役に立てば幸い。

#IfWinActive ahk_class CabinetWClass
RButton::
    While GetKeyState("RButton", "P")       ; while Rbutton is held down
        if GetKeyState("LButton", "P") {        ; if Lbutton is pressed
            GoSub, LabelAction 
            Return
        }
    SendInput {RButton}
return
#IfWinActive

LabelAction:
    msgbox, 64, % A_ThisLabel, Do some actions here.
Return
于 2012-11-29T19:24:34.230 に答える