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.

How to use event "down" a. "up" f. volume in webserver

If you have a question or need help, this is the place to be.
Post Reply
Siutsch
Experienced User
Posts: 51
Joined: Wed Apr 28, 2010 6:53 am

How to use event "down" a. "up" f. volume in webserver

Post by Siutsch »

Hi,

I use EC as a control of my home theater equipment including lighting and control of my HTPC.

Except with a Logitech Harmony I will control everything via web interface with a pad,
implemented with the dynamic web server from EC.

(I use JQuerymobile, it looks very good and is easy to implement).


I now have the following problem:
By using the web server from EC to press a button for volume up (and low), EG gets two events, one when you press and another when you release the button (.down and .up).

Currently I use the command for volume up and volume down only with the ".Down" command
as an event with the corresponding IR command (USB-UIRT).

As a result when you press for example the button for volume up, exactly one IR command will be sent to the Amp and set it only 1DB louder.
Will I make much more than just a little louder, I have to press the button several times successively.

Is it somehow possible that the IR-command will send after pressing the button (.down) and repeat it perhaps once a second to let it be slowly louder and louder, until I release the button (and sent the ".up" event) to stop this?

So virtually the same thing that happened with the EG command for "repeat" if a button is pressed for longer time?

From the web interface will the two separate events for ".down" and ".up" then produced with a longer delay between these both events.

I unfortunately still can not solve it, maybe one of you have an idea how to realize this.

And I hope I could explain what I mean (mainly because my English is terrible!). :roll:

Thankz,
Siutsch.
Siutsch
Experienced User
Posts: 51
Joined: Wed Apr 28, 2010 6:53 am

Re: How to use event "down" a. "up" f. volume in webserver

Post by Siutsch »

Nobody has any idea?

Or have I described the problem badly?

Siutsch.
Tal56
Posts: 20
Joined: Tue Jun 22, 2010 6:47 pm

Re: How to use event "down" a. "up" f. volume in webserver

Post by Tal56 »

Not sure but have you tried using the Autorepeat feature? I haven't used it before yet, but I believe that's what it's for.
Siutsch
Experienced User
Posts: 51
Joined: Wed Apr 28, 2010 6:53 am

Re: How to use event "down" a. "up" f. volume in webserver

Post by Siutsch »

Therefore I wrote:
"So virtually the same thing that happened with the EG command for "repeat" if a button is pressed for longer time?"

The autorepeat feature works only if you press a button longer!

But in this case I have only one single event if I press the button, and another one if I release it.

Between these two events I want to repeat the IR-command until I release the button and the event for that is generated.

Not easy to explain ...

Siutsch.
eatmeimadanish
Experienced User
Posts: 118
Joined: Thu Oct 01, 2009 5:11 pm

Re: How to use event "down" a. "up" f. volume in webserver

Post by eatmeimadanish »

What you want to do is have the down event start a loop and stop the loop once the up event occurs.

So you would probably want to have a disabled folder, that gets enabled with a down event, that then repeats itself until the up event disables that folder. I am not sure about paralleling events during a loop if one will either wait until the event is complete. Ill test.
eatmeimadanish
Experienced User
Posts: 118
Joined: Thu Oct 01, 2009 5:11 pm

Re: How to use event "down" a. "up" f. volume in webserver

Post by eatmeimadanish »

Ok so I figured this out.

You will need 4 macros.

One is the Loop event : Triggers the event you want to act on, then triggers the event that initiates the loop
Two is the Jump event : This event triggers an event that starts number One. It must have a delay in it (half a second).
Three is the Up Action Event : This activates when the button is released, and disables number Two.
Four is the Down Action event : This enables Two and initiates One.

So as long as the button is held down, the action continues until the up event disables number Two.

here is a copy of my XML, replace event names with whatever.

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1397" Guid="{E5A46626-DC24-424B-B99D-ADF9A65734FF}" Time="1307566346.87">
    <Autostart Name="Autostart" Expanded="True">
        <Plugin Identifier="DynamicWebserver" Guid="{2FC713FF-0093-4271-A520-F0F6BB05A0E8}" File="DynamicWebserver">
            gAIoWAcAAAB3d3dyb290cQBLUFhCAAAAQzpcUHJvZ3JhbSBGaWxlcyAoeDg2KVxFdmVudEdob3N0XHBsdWdpbnNcRHluYW1pY1dlYnNlcnZlclx3d3dyb290cQFYCgAAAEV2ZW50R2hvc3RxAlgAAAAAcQNoA3RxBC4=
        </Plugin>
    </Autostart>
    <Folder Name="Macro" Expanded="True">
        <Macro Name="Loop" Expanded="True">
            <Event Name="Main.LoopEvent" />
            <Action>
                EventGhost.TriggerEvent(u'VolumeUp', 0.0)
            </Action>
            <Action>
                EventGhost.TriggerEvent(u'jumptoloop', 0.0)
            </Action>
        </Macro>
        <Macro Name='Jump to "Loop"' id="10" Enabled="False" Expanded="True">
            <Event Name="Main.jumptoloop" />
            <Action>
                EventGhost.TriggerEvent(u'LoopEvent', 0.5)
            </Action>
        </Macro>
        <Macro Name='Disable: Jump to "Loop"' Expanded="True">
            <Event Name="wwwroot.VolumeUP.button" />
            <Action>
                EventGhost.DisableItem(XmlIdLink(10))
            </Action>
        </Macro>
        <Macro Name='Enable: Jump to "Loop"' Expanded="True">
            <Event Name="wwwroot.VolumeUP.button_down" />
            <Action>
                EventGhost.EnableItem(XmlIdLink(10))
            </Action>
            <Action>
                EventGhost.TriggerEvent(u'Main.LoopEvent', 0.0)
            </Action>
        </Macro>
    </Folder>
</EventGhost>
Siutsch
Experienced User
Posts: 51
Joined: Wed Apr 28, 2010 6:53 am

Re: How to use event "down" a. "up" f. volume in webserver

Post by Siutsch »

Thankz! :)

I will try it.

Sorry for late answer, was in holiday for over 3 weeks.

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

Re: How to use event "down" a. "up" f. volume in webserver

Post by Pako »

I just point out that the Dynamic Webserver is obsolete plugin and will be removed from the installation file.
Use plugin Webserver.

Pako
Siutsch
Experienced User
Posts: 51
Joined: Wed Apr 28, 2010 6:53 am

Re: How to use event "down" a. "up" f. volume in webserver

Post by Siutsch »

Again Thank you!

Basically everything went fine.

Unfortunately the Browser (each I tried) with my new Honeycomb Pad does not accept long keypresses! :(

After a second or so, a menu will appear and the event for releasing the Button is not triggered.

I don't know how to press a button longer without coming up these menu.

Perhaps with an Ipad this works, but not with an Android Pad I suspect.

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

Re: How to use event "down" a. "up" f. volume in webserver

Post by Pako »

With this problem I can not help.
I do not have (and no one else in my neighborhood) any smart phone (or any similar device).
For me it is very expensive.

Pako
eatmeimadanish
Experienced User
Posts: 118
Joined: Thu Oct 01, 2009 5:11 pm

Re: How to use event "down" a. "up" f. volume in webserver

Post by eatmeimadanish »

Make sure in your web code, that you have additional commands for touchstart and touchend. I know in mine it was mouseclick up and mouseclick down which only works for desktop browsers and not the IPAD (and probably honeycomb). You may also want to try using jquery.
Siutsch
Experienced User
Posts: 51
Joined: Wed Apr 28, 2010 6:53 am

Re: How to use event "down" a. "up" f. volume in webserver

Post by Siutsch »

Thankz for this tip.

I'm not as fit in HTML programming, but I will try.

I do not know if you can solve the problem at all because the browsers always interpret a long click as right mouse button
and it opens a menu with extra commands like mark, copy, etc. which is similar in all tested browsers.

If you could somehow disable that in the HTML code, that would be great.

Maybe there are extra opportunities for Jquerymobile to do this...

Siutsch.
Post Reply