OK、動作を切り替えたいようです。
#SingleInstance Force
#installKeybdHook
#Persistent
SetTitleMatchMode, 2 ; Make search title in #IfWinActive more flexible
#IfWinActive, Title of your game as found by AHK Windows Spy
RButton::
If (Toggler := !Toggler )
{
ToolTip, RButton Down
Send, {RButton Down} q
Return
}
ToolTip, RButton Up
Send {RButton Up} q
Return
#IfWinActive
Return
*x::
ExitApp
アップデート
あなたのテキストを読んだ後(そしてあなたが行動を切り替えたいところのあなたのスクリプトを無視した後)、私はあなたがこれを望んでいると思います!を放すまで、RightClick
を送信しますが、何も送信しません。その後、を送信します。ツールチップを追加したので、スクリプトが#IfWinActiveによって正しくアクティブ化されているかどうかを確認できます。RightClick Down + q
RightClick
RightClick Up + q
#SingleInstance Force
#installKeybdHook
#Persistent
SetTitleMatchMode, 2 ; Make search title in #IfWinActive more flexible
#IfWinActive, Title of your game as found by AHK Windows Spy
RButton::
ToolTip, RButton Down + q
Send, {RButton Down} q
Return
RButton Up::
ToolTip, RButton Up + q
Send, {RButton Up} q
Return
#IfWinActive
Return
*x::
ExitApp
これが本当にあなたが望むものであるならば、最終的な解決策はArminからの元のヒントにかなり近づいています!
アップデート2、代替方法
#SingleInstance Force
#installKeybdHook
#Persistent
SetTitleMatchMode, 2 ; Make search title in #IfWinActive more flexible
#IfWinActive, Title of your game as found by AHK Windows Spy
*~RButton:: ; ~ passes Rbutton through
ToolTip, RButton Down + q
Send, q
KeyWait, RButton ; Wait for RButton to be released
ToolTip, RButton Up + q
Send, q
Return
#IfWinActive
Return
*x::
ExitApp