Configure 'home key' to switch monitor?
#1
Im pretty sure there's a way to configure my new remote's 'home' key to activate XBMC as opposed to MCE by renaming eshell.exe and replacing it with a self compiled batch file.

it would be great if this same batch file could also switch my display to my secondary monitor as opposed to the primary monitor. is there any way to do this without a some fancy mouse tracking autohotkey script?

in windows 7, i know they greatly simplified the multi-monitor setup.

if you press the 'windows key + p', you get a delightfully concise little menu asking whether or not you want to use your primary monitor, secondary monitor, clone mode, or extended desktop. is there another keyboard shortcut or anything that could make one of these specific changes immediately?
Reply
#2
There might be a way to do it using wmic.exe. Some quick Googling revealed wmic can change screen resolution, but I couldn't find any info on changing the multiple display settings.

JR
Reply
#3
Not an easy or elegant solution but this works for me

I use some free software called 12noon display changer
http://www.12noon.com/displaychanger.htm

coupled with Perl
http://www.activestate.com/activeperl/downloads

I use autohotkey to trap browser_home and call a perl script (which can be easily ported to batch to skip the perl install). This file runs display changer to switch back and forth between monitors and launch/exit XBMC with the push of a button


Here is the perl script.
#!perl

print "Determining what monitor we are\n";

my $prim_display;
my $DCC_Path = 'C:\\Program Files\\12noon Display Changer';
my @response = `\"C:\\Program Files\\12noon Display Changer\\dccmd.exe\" -listmonitors`;

foreach (@response)
{
if (/DISPLAY/)
{
/(.+)DISPLAY(.)/;
$prim_display = $2
}
if (/attached/i) { last; }
}

print "We are display: $prim_display\n";

if ($prim_display == 1)
{
print "Changing To LCD\n";
`START /D\"$DCC_Path" dc.exe -monitor=\"\\\\\.\\DISPLAY2\" -quiet -more -primary -apply`;
`START /D\"$DCC_Path" dc.exe -monitor=\"\\\\\.\\DISPLAY1\" -quiet -more -secondary -detach -apply`;
}
elsif ($prim_display == 2)
{
print "Changing To TV\n";
`START /D\"$DCC_Path" dc.exe -monitor=\"\\\\\.\\DISPLAY1\" -quiet -more -primary -apply`;
`START /D\"$DCC_Path" dc.exe -monitor=\"\\\\\.\\DISPLAY2\" -quiet -more -secondary -detach -apply`;
}
else
{
print "Error: Unknown Display. Aborting...\n";
exit 1;
}
Reply
#4
RobS

Thank you for the Perl script. Could you please post the Autohotkey script "Run," or "RunWait" commands to load the perl script properly and have Autohotkey wait till the perl script is done? Here's what I'm trying to do in AutoHotkey but my issue is getting the run / wait on perl to work:

#NoEnv

;Alt-1 Monitor-1440x900 32bit 60hz & PC Sound
!1::
;run displayswitch /external
RunWait, "perl.exe c:\perl64\swap_monitors.pl"
Sleep, 800
; *** Set Audio Output to PC ***
Run, mmsys.cpl
WinWait,Sound
ControlSend,SysListView321,{Down 2}
ControlGet, isEnabled, Enabled,,&Set Default
ControlClick,&Set Default
ControlClick,OK
WinWaitClose
SoundPlay, *-1
return

;Alt-2 LCD TV-1920×1080 32bit & TV Sound
!2::
;run displayswitch /internal
RunWait, "perl.exe c:\perl64\swap_monitors.pl"
Sleep, 800
; *** Set Audio Output to Digital out/TV ***
Run, mmsys.cpl
WinWait,Sound
ControlSend,SysListView321,{Down 3}
ControlGet, isEnabled, Enabled,,&Set Default
ControlClick,&Set Default
ControlClick,OK
WinWaitClose
SoundPlay, *-1
return

I've also tried: "RunWait, %comspec% /c perl.exe swap_monitors.pl" in autohotkey to get it to run but autohotkey won't wait for the perl script to finish.

Any assistance is greatly appreciated.

Oh and does anyone have any tips on how to get an eHome (MS) IR reciever that is configured to be "wake_armed" to awake the computer to get out of S3 sleep? I think it works on the "power toggle" but I'd like discrete commands if I can get it setup. So it's reliable PowerON (not worried about PowerOff)?

I've tried my Harmony One sending MCE PowerOn command and it's ignored. PowerToggle works.
Reply
#5
Beaker1024 kinda out of my league wrt to autohotkey. I'm not even sure what your script is trying todo.

I just put this line in my hotkey script

Browser_Home::
SoundSetWaveVolume, 100
SoundSet 100
Run, C:\Documents and Settings\roberts\My Documents\scripts\Movie Time\change.pl, ,Hide;
return

Now when I press the browser_home key the script executes, keeping the cmd prompt hidden.
Reply

Logout Mark Read Team Forum Stats Members Help
Configure 'home key' to switch monitor?0