Skip to content

Commit

Permalink
BH3_Hotkey_Simplified.ahk
Browse files Browse the repository at this point in the history
  • Loading branch information
Spr-Aachen committed Mar 10, 2022
1 parent 7dd5ee0 commit 0fe940d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions BH3_Hotkey_Simplified.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,19 @@ SwitchIME(dwLayout) ; 该段用于管理输入法,请勿删改
SendMessage, 0x50, 0, HKL, %ctl%, A
}


F1:: ; 暂停/ 启用程序——若想正常使用鼠标请按该键或按住ALT键
Suspend, Toggle
WinSet, AlwaysOnTop, Off, A
SetTimer, ViewControlTemp, Off
SendInput, {Click, Up Middle}
SwitchIME(0x04090409) ; 切换至"中文(中国) 简体中文-美式键盘"
;Send, #{Space} ; [未启用命令行] 微软拼音用户可用该命令
If (A_IsSuspended=1)
If (A_IsSuspended)
ToolTip, 暂停中, 0, 999 ; [可调校数值]
Else If (A_IsSuspended=0)
{
M_Toggle:=!M_Toggle
If (M_Toggle)
M_Toggle:=!M_Toggle
ToolTip, 已启用, 0, 999 ; [可调校数值]
Sleep 210 ; [可调校数值]
ToolTip
Expand Down Expand Up @@ -122,12 +122,12 @@ Return
;---------------------------------------------------------------------------------------------------------------------------------------------------------------

ViewControl:
if WinActive("ahk_exe BH3.exe")
If WinActive("ahk_exe BH3.exe")
{
SendInput, {Click, Down Middle}
CoordMode, Window
WinGetPos, X, Y, Width, Height, ahk_exe BH3.exe ; 获取崩坏3游戏窗口参数(同样适用于非全屏)
MouseMove, Width/2, Height/2, 0 ; [建议保持数值] 使鼠标回正,居中于窗口
SendInput, {Click, Down Middle}
}
Return

Expand Down Expand Up @@ -197,9 +197,9 @@ LButton:: ; 点按鼠标左键以发动普攻
Send, {j Down}
If (M_Toggle)
{
While GetKeyState("LButton", "P")
If GetKeyState("LButton", "P")
{
SetTimer, ViewControl, Off
SetTimer, ViewControl, Off
SetTimer, ViewControlTemp, 0 ; [[可调校数值]] 设定视角跟随命令的每执行间隔时间(ms)
}
}
Expand Down

0 comments on commit 0fe940d

Please sign in to comment.