• Hey, guest user. Hope you're enjoying NeoGAF! Have you considered registering for an account? Come join us and add your take to the daily discourse.

Automatic Input Switching On PC? Need Advice on Steam Scripts, Other Methods

SOLDIER

Member
I know I'm not the only one who prefers the majority of PC gaming through "comfy couch" means. Ever since Steam's Big Picture Mode came out, I've greatly enjoyed playing the majority of games on my big TV, home theater speakers, and all other console conveniences.

But with most things involving a PC, it takes a bit of work to achieve that comfort. Due to the multiple devices I have plugged into my PC, I've obsessed over coming up with an automated method to tell my PC which screen to use, which audio source, etc.

To break it down, I have the following monitors plugged in:

1. PC Monitor

2. Big Screen TV

For audio sources, I have three:

3. PC Speakers/Headphones

4. Home Theater Speakers

5. Sony Gold Wireless Headset

What I want to do is have my PC automatically select the monitor and audio combination I want at the push of a button. A while back there was a user who suggested using Auto Hotkey Scripts, which I have been using.

Ideally, the script would work like this:

1. Push a button combination on the controller (for me it's LT+Start)

2. Steam BPM starts

3. Video output switches from PC monitor to TV monitor, Audio output switches from PC speakers to Home Theater

4. When I exit BPM, it switches back

Ideal, right?

I currently have two problems, however. For one thing, exiting BPM switches the video source back but not the audio source, leaving it on the Home Theater as the default.

The other problem is that now I want to include my Gold headset as an option, meaning that I want to make it so I can push a different combination of buttons so that starting BPM puts my settings on TV as Video and Gold Headset as Audio.

I have zero knowledge with scripting, though, so I wouldn't know how to adjust my current script to achieve that. The user who created the original script tried to explain it to me, but it kind of went over my head. Here's the script in question:

;Use the full path of where you extract VA.ahk
#Include C:\VA.ahk

;modify with the hotkey you would like to use
;or delete the line and run the script from your desktop when you want to switch
F4::

;Checks if big picture mode is already running, if it is then don't execute the rest of the script
IfWinExist, Steam ahk_class CUIEngineWin32 ;checks to see if the big picture mode window is running
return

;Switches displays with internal rendering mode enabled
Run, "C:\Windows\System32\DisplaySwitch.exe" /external

;Switch to sound device to use with the television
Run, "C:\Windows\ssd.exe" 1

;Stores the old volume of the device to be used when gaming
oldVol := VA_GetMasterVolume()

;Gets the current hour in 24 hour format Midnight = 0, 11pm = 23
FormatTime, aTimeH, A_Now, H
if(aTimeH < 8)
;set a low volume if it's after midnight but before 8am
VA_SetMasterVolume(100.0)
else
;Set the volume to what you want to game at
VA_SetMasterVolume(100.0)

;Set x and y to the resolutions of your television
Run, "C:\Windows\qres.exe" /x:1920 /y:1080 /c:32

;Checks if Steam is running and open big picture mode accordingly
Process, Exist, Steam.exe
if ErrorLevel
Run, "steam://open/bigpicture"
else
Run, "C:\Program Files(x86)\Steam\Steam.exe" -bigpicture

;Waits for big picture mode to open
WinWait, Steam ahk_class CUIEngineWin32

;Waits for big picture mode to close
WinWaitClose, Steam ahk_class CUIEngineWin32

;Restore the old volume of the sound device
VA_SetMasterVolume(oldVol)

;Switch back to your primary sound device
Run, "C:\Windows\ssd.exe" 3

;Switch back to your primary display
Run, "Displayswitch.exe" /clone

;set x and y to the resolutions of your primary display
Run, "C:\Windows\qres.exe" /x:1920 /y:1080 /c:32
return

I'm not sure why it won't switch back to the PC's audio source, as everything seems to check out, so I'm hoping someone here can tell me how to fix it as well as adding the option to switch to my Gold headset.

If there's actually an even easier way to do all this, I'd like to hear it as well. I just want to achieve the convenience of my Logitech remote and just have all the inputs switch automatically depending what kind of gaming I want to do.
 
Top Bottom