Notice: This forum has been recovered from an old backup, so some content, links, and dates may be outdated. The forum is currently read-only while we restore sign-in and registration functionality. Details

If you find this forum valuable and would like to help keep it online, donations to help cover hosting and domain costs are greatly appreciated, but never expected. You can support the forum through Buy Me a Coffee or Ko-fi. Thank you for helping preserve the EventGhost community.

Toggle Button - Monitor Off

If you have a question or need help, this is the place to be.
Post Reply
alpine1
Posts: 2
Joined: Tue Oct 02, 2007 6:30 pm

Toggle Button - Monitor Off

Post by alpine1 »

Instead of assigning a Monitor On/Off to 2 separate button. Is it possible to use one button and test for monitor state before jumping?

Code: Select all

psuedo:
if ( IsMonitorOff() )
     System.MonitorPowerOff().
else
     System.MonitorPowerOn().
User avatar
Bitmonster
Site Admin
Posts: 2239
Joined: Mon Feb 06, 2006 10:28 pm

Re: Toggle Button - Monitor Off

Post by Bitmonster »

It's not possible to query the current monitor state (as far as I know). So all you can do is build a toggling action like this (assign the wanted event to both macros):

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1129">
    <Folder Name="Toggle Monitor State" Expanded="True">
        <Macro Name="Monitor Standby" id="1860" Expanded="True">
            <Event Name="X10.Radio">
            </Event>
            <Action>
                System.MonitorStandby()
            </Action>
            <Action>
                EventGhost.EnableExclusive(XmlIdLink(1862))
            </Action>
        </Macro>
        <Macro Name="Monitor Reactivate" id="1862" Enabled="False" Expanded="True">
            <Event Name="X10.Radio">
            </Event>
            <Action>
                System.MonitorPowerOn()
            </Action>
            <Action>
                EventGhost.EnableExclusive(XmlIdLink(1860))
            </Action>
        </Macro>
    </Folder>
</EventGhost>
Please post software-related questions in the forum - PMs will only be answered, if really private, thanks!
alpine1
Posts: 2
Joined: Tue Oct 02, 2007 6:30 pm

Re: Toggle Button - Monitor Off

Post by alpine1 »

Wonderful approach, thank you! I bet this idea would come in very handle with some of my other macros.
stisev
Experienced User
Posts: 162
Joined: Tue Jun 26, 2007 2:55 am

Re: Toggle Button - Monitor Off

Post by stisev »

I have nothing to really add, but to just say that this worked for and is a wonderful idea.

Also, people - make sure you KEEP the entries in the folder BitMonster put them in (just copy and paste); otherwise, it'll disable the other macros inside of the folder!
CollinR
Experienced User
Posts: 265
Joined: Tue Sep 05, 2006 7:16 am
Location: Oklahoma
Contact:

Re: Toggle Button - Monitor Off

Post by CollinR »

Yeah that is a sweet trick for several instances.

In my case which input on my amp? Luckily I only have two I use.


However this logic won't work for things you also have local control over, or use that control....

Errr ax that :x , I just realized worst case you need to push the button twice! So even x10 can use this for scene control allowing one FireFly button to toggle through lighting scenes OFF>Dim>Bright>ON. Very cool as I have more lighting scenes then I do unlabeled buttons.

For some reason I have enable exclusives linked to folders in my mind and never tried individual macros, this will help alot. I dunno how I got that confused. :o
Post Reply