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.

Action at the end of enduring event

If you have a question or need help, this is the place to be.
Post Reply
maphix
Posts: 2
Joined: Thu Nov 17, 2011 5:19 pm

Action at the end of enduring event

Post by maphix »

Hi,

I'd like to trigger an action at the end of enduring event. Is that possible somehow?

I'd like to to following:
When volume up key is pressed on remote I want to start action "button volume up pressed" and when the key is released I want to start action "button volume up released".

I use X10 plugin which creates enduring events correctly. I just didn't found anything in EventGhost which would allow me to trigger another action when enduring event ends.

Thanks in advance for help.
maphix
Posts: 2
Joined: Thu Nov 17, 2011 5:19 pm

Re: Action at the end of enduring event

Post by maphix »

Anyone?
User avatar
Pako
Plugin Developer
Posts: 2294
Joined: Sat Nov 11, 2006 1:31 pm
Location: Czech Republic
Contact:

Re: Action at the end of enduring event

Post by Pako »

Suppose Test.Test is an enduring event.
EnduringEvent.png
EnduringEvent.png (3.36 KiB) Viewed 1003 times
Then the following script does what you need:

Code: Select all

evt = eg.event
def TestEnd():
    if not evt.isEnded:
        eg.scheduler.AddTask(0.01, TestEnd)
    else:
        eg.TriggerEvent("Stop", prefix = "EnduringEvent")
eg.TriggerEvent("Start", prefix = "EnduringEvent")
TestEnd()
At the beginning is triggered event EnduringEvent.Start and at the end is triggered event EnduringEvent.Stop.
However, I do not know if it will have practical use.
I do not have the opportunity to try it.

Pako
Post Reply