13

我想用 AutoHotkey 改变我的显示器输入源,我有这个部分工作。但是,当我使用热键将显示器输入源从 pc(DVI) 更改为我的 xbox(YPbYr) 时,显示器没有检测到 xbox 已打开,它说没有源。

显示器 => 华硕 vg236

我的监视器的 VCP 监视器输入源代码:

  • DVI => 3
  • HDMI => 4
  • YPbPr => 12

我正在使用Windows API 监视器配置函数,特别是使用 DDC/CI 的 SetVCPFeature 函数。

经过一些研究,我决定我要设置 VCP 输入源,这有一些有用的信息,特别是在第 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 代码值以通知监视器源已更改。

注意:我没有 HDMI 设备,所以我不知道这是否只影响 YPbYr 或所有输入。

问题:如何让我的显示器识别 YBpYr 已打开,因为现在显示器的行为就像 YBpYr 未打开一样?

问题:除了 0x60 输入源之外,我是否需要设置另一个 VCP 代码值?

4

0 回答 0