確定它看起來像要切換行爲。
#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
將發送RightClick Down + q
,然後一無所獲,直到你放開RightClick
,然後發送RightClick Up + q
。我添加了工具提示,所以你可以看到腳本是否被#IfWinActive正確激活。
#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
你能嘗試重寫你的問題,因爲它不是很清楚你想要的! Q按鈕意味着什麼?這是一個帶Q的軟件按鈕嗎?或者你的意思是Q鍵? – 2013-03-18 10:01:49
我加了一些解釋 – CamSpy 2013-03-18 12:42:00