if !A_IsAdmin
Run % “*RunAs ” (s:=A_IsCompiled ? “” : A_AhkPath ” /r “) “””” A_ScriptFullPath “””” (s ? “” : ” /r”)
SetWorkingDir %A_ScriptDir%
#NoEnv
#InstallKeybdHook
#InstallMouseHook
#KeyHistory 0
#UseHook
#MaxThreadsPerHotkey 1
#MaxHotkeysPerInterval 1000
ListLines, Off
SetBatchLines, -1
SetKeyDelay, 0
窗口hwnd := ” “
F1::
if (窗口hwnd = ” “) ;若 变量 窗口hwnd 为空
{
窗口hwnd := WinExist(“A”) ;获得鼠标指向的活动窗口ID ,赋值给变量 窗口hwnd
}
if (onoff := !onoff)
{
ComObjCreate(“SAPI.SpVoice”).Speak(“按键开启”)
Settimer, LianFa, 50
}
else
{
ComObjCreate(“SAPI.SpVoice”).Speak(“按键关闭”)
Settimer, LianFa, Off
窗口hwnd := ” “
}
Return
LianFa: ;设置名为 连发 的标签
{
ControlClick, , ahk_id %窗口hwnd% , , X2 ;发送(XButton2: 第2个鼠标侧键)到窗口
Sleep 10
Return
}
mark