STEAM GROUP
Big Picture bigpic
STEAM GROUP
Big Picture bigpic
966
IN-GAME
5,040
ONLINE
Founded
September 10, 2012
Joesome Sep 30, 2015 @ 12:49pm
Fully automated BigPicture TV Mode aka the "CouchMode-Script"
Hello Everyone. Ever wished to start Big Picture Mode on your TV without having to change your primary display and audio output device first? Without having to start everything manually, move your Cursor away which is bugging your "Console Experience”? And after that manually changing everything back to normal...? Well, me too!

But since nothing I found came close to my “optimal solution” I had in mind, I took things into my own hands and with the help of AutoHotKey and the very helpful AHK Forums I was able to write/assemble a neat Script which does all that by one Gamepad button Press combination. And I thought: Why not share it?

What this Script does:
1. changes your active display to your TV/second Display
2. changes your sound output to your TV (or any other device)
3. Opens Steam Big Picture Mode (regardless if Steam is already running or not)
4. Hides the Windows mouse cursor
5. Reverts everything back to normal when ending Big Picture Mode

What you need:
1. Second display connected via HDMI or DP (This was made with a TV in mind)
2. AutoHotKey (Download here [www.autohotkey.com])
3. A XBox360/XBO Controller (other Controllers may also work…)
4. The power of reading

Guide:
Just install AutoHotKey, create a .ahk-File and insert the code below. Then save and start the file. After that you can easily start the script by pressing “select” + “start” on your XBO/Xbox360 Controller. You may have to edit the Script (I recommend Notepad++) to make sure that the Sound output is toggled correctly since I cannot know your Sound setup. The respective lines are commented and explained in the script so that you can change it easily.

Also: If you want to change the Hotkey combination just edit the script. As I did for the Sound Output toggle, these particular lines are commented and can be changed to your liking.

Code:
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. #IfWinNotExist, Steam ahk_class CUIEngineWin32 Joy8:: ; in this line and the one below you can choose the Buttons of your Gamepad you want to use as Hotkey for this script. Currently "Select" (Joy7) + "Start" (Joy 8) on XBOne Controller is set. If GetKeyState("Joy7") { run displayswitch /external ; display switching to TV. Can also be set to "/clone" or "/extend" if neeeded Sleep, 1000 ; timer to wait until the TV Sound output is recognized. Sound toggle won't work if set too low Run, mmsys.cpl Winwait, Sound ControlSend, SysListView321, {Down 1} ; Choose your desired (BigPicture) Sound output here. Go to your "Sound output device list" and check the position of your audio output device (e.g. TV). If it is first in List just input "{Down 1}" if it's 2nd "{Down 2}" and so on. ControlClick, &Set Default ; Depending System Language this has to be changed to the actual name of the "Set Default" Button (Eg. "Als Standard" for German) ControlClick, OK WinWaitClose SetSystemCursor("") Process, Exist, Steam.exe if ErrorLevel Run, "steam://open/bigpicture" else Run, "C:\Games\Steam\steam.exe" -bigpicture WinActivate, Steam ahk_class CUIEngineWin32 WinWait, Steam ahk_class CUIEngineWin32 WinWaitClose, Steam ahk_class CUIEngineWin32 Run, mmsys.cpl Winwait, Sound ControlSend, SysListView321, {Down 2} ; Choose your standard Sound output here. Same procedure as above. ControlClick, &Als Standard ControlClick, OK WinWaitClose RestoreCursors() run displayswitch /internal ; Switching back to primary/internal Display . Can also be set to "/clone" or "/extend" if neeeded return } return SetSystemCursor( Cursor = "", cx = 0, cy = 0 ) ; this is needed to hide the cursor. Do not change. { BlankCursor := 0, ; init SystemCursors = 32512IDC_ARROW,32513IDC_IBEAM,32514IDC_WAIT,32515IDC_CROSS ,32516IDC_UPARROW,32640IDC_SIZE,32641IDC_ICON,32642IDC_SIZENWSE ,32643IDC_SIZENESW,32644IDC_SIZEWE,32645IDC_SIZENS,32646IDC_SIZEALL ,32648IDC_NO,32649IDC_HAND,32650IDC_APPSTARTING,32651IDC_HELP If Cursor = { VarSetCapacity( AndMask, 32*4, 0xFF ), VarSetCapacity( XorMask, 32*4, 0 ) BlankCursor = 1 ; flag for later } Else { Msgbox,, SetCursor, Error: Invalid file path or cursor name CursorHandle = Error ; raise for later } If CursorHandle != Error { Loop, Parse, SystemCursors, `, { If BlankCursor = 1 { Type = BlankCursor %Type%%A_Index% := DllCall( "CreateCursor" , Uint,0, Int,0, Int,0, Int,32, Int,32, Uint,&AndMask, Uint,&XorMask ) CursorHandle := DllCall( "CopyImage", Uint,%Type%%A_Index%, Uint,0x2, Int,0, Int,0, Int,0 ) DllCall( "SetSystemCursor", Uint,CursorHandle, Int,SubStr( A_Loopfield, 1, 5 ) ) } } } } RestoreCursors() { SPI_SETCURSORS := 0x57 DllCall( "SystemParametersInfo", UInt,SPI_SETCURSORS, UInt,0, UInt,0, UInt,0 ) }

I hope my handy little script can help some people with a similar Setup! ;)

-Joesome


Note:
Most of my work consisted of combining great scripts I found here:

http://www.autohotkey.com/board/topic/32608-changing-the-system-cursor/
http://www.autohotkey.com/board/topic/20084-secondary-monitor/page-4?&
http://www.autohotkey.com/board/topic/68257-toggle-set-default-audio-device-in-windows-7/

I take no credit for the work of these very smart guys! ;)
Last edited by Joesome; Oct 1, 2015 @ 6:32am
< >
Showing 1-2 of 2 comments
gladkovbro<3K. Oct 1, 2015 @ 1:29am 
Nice fix
StickmaN Sep 19, 2024 @ 4:01pm 
Great job.

I found an alternative solution for the displayswitch if you`re using 3+ monitors. Is the MonitorSwitcher (https://sourceforge.net/projects/monitorswitcher/).
Just create the profiles you need and run the command in CMD, in case of ahk or some automations. Done!

EDIT: I suggets try the Nircmd from Nirsoft to set the Default Speaker like this:

path/to/the/software/nircmd.exe setdefaultsounddevice "Your Device Name" 1 path/to/the/software/nircmd.exe setdefaultsounddevice "Your Device Name" 2

1 for Multimedia, and 2 for Communications
Last edited by StickmaN; Sep 19, 2024 @ 4:34pm
< >
Showing 1-2 of 2 comments
Per page: 1530 50