13

I want to change my monitor input source with AutoHotkey, and I have this partially working. However when I use the hotkey to change the Monitor Input Source to my xbox(YPbYr) from pc(DVI), the monitor doesn't detect that the xbox is on, it says no source.

Monitor => Asus vg236

VCP Monitor Input Source codes for my monitor:

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

I'm using the Windows API Monitor Configuration Functions specifically the SetVCPFeature function which uses DDC/CI.

After some research I've decided I want to set the VCP Input Source this has some useful information specifically on page 71 about the Input Source.

AutoHotkey Code:

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

I'm wondering if I need to set another VCP code value somewhere to notify the monitor the source has changed.

Note: I have no HDMI devices so I can't tell if this only affects YPbYr or all inputs.

Question: how do I make my monitor recognize YBpYr is on, as right now the monitor acts as if YBpYr is not on?

Question: Do I need to set another VCP code value other than the 0x60 Input Source?

Lifeweaver
  • 986
  • 8
  • 29
  • 2
    Are you sure your monitor (fully) supports DDC/CI? I couldn't find a mention of it on this site: https://www.asus.com/us/Monitors/VG236H/specifications/ not even in the manual. For the "VG245H" monitor on the other hand it was mentioned in the manual: https://www.asus.com/Monitors/VG245H/HelpDesk_Manual/ – Forivin Jun 13 '18 at 13:35
  • 1
    No idea, from what I've read support can be spotty, so it's very possible it's not fully supported. – Lifeweaver Jun 14 '18 at 14:27
  • 5
    This is probably not an option, but you could get an Ardunio for $1 and a few relays (one per button on your monitor for $0.5 each) and connect each relay with the Arduino and the + and - of a button. Then you could use AHK to send messages to the Arduino to toggle the relays which the monitor would then register as button presses. – Forivin Jun 15 '18 at 08:30

0 Answers0