我想用 AutoHotkey 更改我的显示器输入源,并且我已经部分工作了。但是,当我使用热键将显示器输入源从 pc(DVI) 更改为我的 xbox(YPbYr) 时,显示器未检测到 xbox 已打开,它显示没有源。
显示器 => 华硕 VG236
VCP 监视器输入 我的监视器的源代码:
- DVI => 3
- HDMI => 4
- YPbPr => 12
我正在使用Windows API监控配置函数 http://msdn.microsoft.com/en-us/library/windows/desktop/dd692964%28v=vs.85%29.aspx特别是使用 DDC/CI 的 SetVCPFeature 函数。
经过一番研究后,我决定设置 VCP 输入源,这有一些有用的信息 ftp://ftp.cis.nctu.edu.tw/pub/csie/Software/X11/private/VeSaSpEcS/VESA_Document_Center_Monitor_Interface/mccsV3.pdf特别是第 71 页有关输入源的内容。
自动热键代码:
setMonitorSource(source)
{
; Initialize Monitor handle
hMon := DllCall("MonitorFromPoint"
, "int64", 0 ; point on monitor
, "uint", 1) ; flag to return primary monitor on failure
; Get Physical Monitor from handle
VarSetCapacity(Physical_Monitor, (A_PtrSize ? A_PtrSize : 4) + 128, 0)
DllCall("dxva2\GetPhysicalMonitorsFromHMONITOR"
, "int", hMon ; monitor handle
, "uint", 1 ; monitor array size
, "int", &Physical_Monitor) ; point to array with monitor
hPhysMon := NumGet(Physical_Monitor)
DllCall("dxva2\SetVCPFeature"
, "int", hPhysMon
, "char", 0x60 ;VCP code for Input Source Select
, "uint", source)
; Destroy handle
DllCall("dxva2\DestroyPhysicalMonitor", "int", hPhysMon)
}
!z::
setMonitorSource(12)
return
我想知道是否需要在某处设置另一个 VCP 代码值来通知监视器源已更改。
Note:我没有 HDMI 设备,因此我无法判断这是否仅影响 YPbYr 还是所有输入。
Question:如何让我的显示器识别出 YBpYr 已打开,因为现在显示器的行为就像 YBpYr 未打开一样?
Question: 除了 0x60 输入源之外,我还需要设置另一个 VCP 代码值吗?