Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Change Monitor Input Source


  • Please log in to reply
2 replies to this topic
RaVNzCRoFT
  • Members
  • 8 posts
  • Last active: Nov 02 2010 02:37 AM
  • Joined: 17 Aug 2010
Is there any way I can make a script in AutoHotkey that will automatically change my monitor's input source by pressing a hotkey? For example, pressing F10 changes the monitor source from VGA to HDMI. Can I also make a hotkey change other display options?

What I actually want is this:

Hotkey 1 changes monitor source to HDMI and sets display to "fit to screen"
Hotkey 2 changes monitor source to VGA and sets display to "4:3"

Leef_me
  • Moderators
  • 8510 posts
  • Last active: Sep 10 2015 05:50 AM
  • Joined: 08 Apr 2009
The question needs to be asked starting from the other end. Not can AHk do this ... but can the monitor do this... being cotrolled through Windows.

YOU need to find out if the manufacturer of the monitor provides for this capability.
If they do, then the next question is what driver is required to access this functionality.
And then, what application do they provide for you to conttrol the operation.

Rapte_Of_Suzaku
  • Members
  • 901 posts
  • Last active: Jul 08 2011 02:12 PM
  • Joined: 29 Feb 2008
I have some additional suggestions (though as Leef_me stated, it depends largely on what your monitor is capable of):[*:mz36hrvn]Some monitors will switch automatically if one of the input sources deactivates and another one activates. Rather than messing with monitor-specific stuff, it may be easier in this case to figure out how to deactivate one of the input sources from the source (the manual way would be deactivating that specific graphics card in the Device Manager). I don't have any specific examples of how to do this, but IIRC this is not that hard to do in AHK.
[*:mz36hrvn]If you don't mind having windows pop up and such, you might have an easier time making a script that will just send a bunch of clicks and key presses to change various settings through the control panel options for your monitor / graphics card. My graphics card came with a NVIDIA Control panel in which I can change all sorts of settings.
Here's an example of how I apply the method suggested in #2 for switching audio devices:
; quick changing the audio devices
^!F1::SetDefaultAudioDevice(1)
^!F2::SetDefaultAudioDevice(2)
;===============================================================================================================================================================
SetDefaultAudioDevice(n)
{
	run, RunDll32.exe shell32.dll`,Control_RunDLL mmsys.cpl`,`,0
	winwait, Sound ahk_class #32770
	
	Send {Down %n%}!s{Enter}
}
It launches the sound devices dialog (same one you would get by right clicking the volume tray icon and selecting "playback devices"), selects the desired playback device, and presses enter to set it as the default. It sorta bugs me that the sound devices dialog pops up, but it was simple to make and works.