确定它看起来像要切换行为。
#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