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.

Sequence of events

If you have a question or need help, this is the place to be.
Post Reply
Steven185
Posts: 2
Joined: Mon Jul 16, 2012 7:03 am

Sequence of events

Post by Steven185 »

Hello, I'm relatively new to EventGhost and I would like to know if there is a way to make it trigger an action when a very specific -certain- sequences of events happen one after another. I tried a couple of things but at best all the did were to trigger the action multiple times (I want the opposite, to trigger *one* action from multiple events). Any suggestion would be great...

Also on an irrelevant do any of you guys know whether there is any plugin for wiimote "floating" around? Despite my best tries I haven't found one yet.


PS: Excuse my bad English I'm not a native speaker :)
jonib
Plugin Developer
Posts: 1328
Joined: Thu Mar 26, 2009 9:33 pm
Location: Sweden

Re: Sequence of events

Post by jonib »

Steven185 wrote:I would like to know if there is a way to make it trigger an action when a very specific -certain- sequences of events happen one after another.
Below is a screenshot for an example I made, that should show one way of doing it.
It needs me to press tree buttons on my remote in the right sequence to do the ShowOSD action. It will ignore any other events that are in the wrong order.
EGSequence.PNG
EGSequence.PNG (12.92 KiB) Viewed 2069 times
The below is from the log when I pressed Move and Swap and nothing happens, until I press PIP and the rest in order.

Code: Select all

Remote.Move
Remote.Swap
Remote.PIP
   First event
      Enable: Second event
      Disable: First event
Remote.Swap
   Second event
      Enable: Third event
      Disable: Second event
Remote.Move
   Third event
      Show OSD: Sequence finished
      Enable: First event
      Disable: Third event
You can paste the below code in EventGhost to test my example (Of course you need to change the events to something else for it to work):

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1568">
    <Folder Name="Event sequence">
        <Macro Name="First event" id="1826" Expanded="True">
            <Event Name="Remote.PIP" />
            <Action>
                EventGhost.EnableItem(XmlIdLink(1824))
            </Action>
            <Action>
                EventGhost.DisableItem(XmlIdLink(1826))
            </Action>
        </Macro>
        <Macro Name="Second event" id="1824" Enabled="False" Expanded="True">
            <Event Name="Remote.Swap" />
            <Action>
                EventGhost.EnableItem(XmlIdLink(1822))
            </Action>
            <Action>
                EventGhost.DisableItem(XmlIdLink(1824))
            </Action>
        </Macro>
        <Macro Name="Third event" id="1822" Enabled="False" Expanded="True">
            <Event Name="Remote.Move" />
            <Action>
                EventGhost.ShowOSD(u'Sequence finished', u'0;-24;0;0;0;700;0;0;0;1;0;0;2;32;Arial', (255, 255, 255), (0, 0, 0), 0, (0, 0), 0, 3.0, False)
            </Action>
            <Action>
                EventGhost.EnableItem(XmlIdLink(1826))
            </Action>
            <Action>
                EventGhost.DisableItem(XmlIdLink(1822))
            </Action>
        </Macro>
    </Folder>
</EventGhost>
Hopefully this helps you get the result you are after.

jonib
XBMC2 plugin to control XBMC. If you want to flatter me Image
AnotherPhil
Posts: 1
Joined: Fri Aug 03, 2012 3:33 pm

Re: Sequence of events

Post by AnotherPhil »

Here's another example, but with a timer added to reset folders to their starting state one second after the first key in the sequence. This example launches CCleaner after receiving 123 within the one second window.

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1544" Guid="{71452CD6-E6D6-4586-87A9-F6DD8F1DAF68}" Time="1344007446.97">
    <Autostart Name="Autostart" Expanded="True">
        <Plugin Identifier="Keyboard" Guid="{59CBD10F-C1D8-4ADB-999B-9B76BA360F1F}" File="Keyboard">
            gAIpLg==
        </Plugin>
        <Plugin Identifier="Timer" Guid="{6149CA99-1FCD-4450-9160-7543BC20CFD3}" File="Timer">
            gAIpLg==
        </Plugin>
    </Autostart>
    <Folder Name="Compound Commands" Expanded="True">
        <Macro Name="<unnamed macro>" Expanded="True">
            <Event Name="Timer.ResetCompoundCommand" />
            <Action>
                EventGhost.EnableItem(XmlIdLink(751))
            </Action>
            <Action>
                EventGhost.DisableItem(XmlIdLink(752))
            </Action>
            <Action>
                EventGhost.DisableItem(XmlIdLink(759))
            </Action>
        </Macro>
        <Folder Name="t" id="751" Expanded="True">
            <Macro Name="Enable exclusive: t2" Expanded="True">
                <Event Name="Keyboard.1" />
                <Action>
                    Timer.TimerAction(u'CompoundCommandTimeOut', 0, 1, 1.0, u'ResetCompoundCommand', False, True, 1, u'00:00:00')
                </Action>
                <Action>
                    EventGhost.EnableItem(XmlIdLink(752))
                </Action>
                <Action>
                    EventGhost.DisableItem(XmlIdLink(751))
                </Action>
            </Macro>
        </Folder>
        <Folder Name="t2" id="752" Enabled="False" Expanded="True">
            <Macro Name="<unnamed macro>" Expanded="True">
                <Event Name="Keyboard.2" />
                <Action>
                    EventGhost.EnableItem(XmlIdLink(759))
                </Action>
                <Action>
                    EventGhost.DisableItem(XmlIdLink(752))
                </Action>
            </Macro>
        </Folder>
        <Folder Name="t3" id="759" Enabled="False" Expanded="True">
            <Macro Name="Start Program: CCleaner.exe" Expanded="True">
                <Event Name="Keyboard.3" />
                <Action>
                    System.Execute(u'E:\\Program Files\\CCleaner\\CCleaner.exe', u'', 0, False, 2, u'', False)
                </Action>
            </Macro>
        </Folder>
    </Folder>
</EventGhost>

Attachments
test.xml
(2.4 KiB) Downloaded 122 times
Post Reply