#NoEnv
#SingleInstance, Force
SendMode Input
SetWorkingDir %A_ScriptDir%
SetTitleMatchMode, 3
OnMessage(0x219, "notify_change")
return
notify_change(wParam, lParam, msg, hwnd)
{
global
MyClip := ClipboardAll
Clipboard := ""
ElapsedTime := A_TickCount - StartTime
if (ElapsedTime) and (ElapsedTime < 2500) {
StartTime := A_TickCount
Clipboard := MyClip
return
}
Device1 = 53F88889-1AAF-4353-A047-556B69EC6DA6 ; PS3 Controller
Device2 = 0000110B-0000-1000-8000-00805F9B34FB ; Headset (Mpow MBits S Stereo)
PS = Get-WmiObject Win32_PNPEntity | Sort-Object -Property DeviceID | Format-Table DeviceID | clip
RunWait, PowerShell.exe -Command "%PS%",, Hide
FoundPos := RegExMatch(Clipboard, Device1, Dev1) RegExMatch(Clipboard, Device2, Dev2)
Clipboard := ""
if Dev1 = %Device1%
{
Process, Exist, DS4Windows.exe
if !errorLevel
Run, C:\Programmes\DS4Windows\DS4Windows.exe,,Min ; Programs to Run when device1 is connected
Sleep, 125
Run, C:\Program Files (x86)\Steam\steam.exe,,Min
}
else {
Process, Close, DS4Windows.exe ; Programs to close when device1 is disconnected
Sleep, 125
Process, Close, steam.exe
}
if Dev2 = %Device2%
{
Run, C:\Programmes\nircmd-x64\nircmd.exe setDefaultsounddevice "Mpow MBits S" ; Program to Run when device2 is connected
}
StartTime := A_TickCount
Clipboard := MyClip
}
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
我能说我标题没读懂是要干啥吗?
如果你来命名会如何命名呢?
看看学习