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.

Don't trigger click events when holding

If you have a question or need help, this is the place to be.
Post Reply
matejdro
Posts: 38
Joined: Wed Jul 21, 2010 9:58 am

Don't trigger click events when holding

Post by matejdro »

I have added "jump if holding more than" event, but problem is that if i'm holding button, also click event occurs.

Is there any way to make click event occur only when clicking and not when holding button?
User avatar
jinxdone
Plugin Developer
Posts: 443
Joined: Tue Jan 02, 2007 4:08 pm

Re: Don't trigger click events when holding

Post by jinxdone »

Somethng like this? (copy & paste into EG)

Code: Select all

<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="1397">
    <Folder Name="example" Expanded="True">
        <Macro Name="Jump if long press">
            <Event Name="KIRA.RC5.TV1.33" />
            <Action>
                EventGhost.JumpIfLongPress(2.0, XmlIdLink(409))
            </Action>
            <Action>
                EventGhost.NewJumpIf(XmlIdLink(413), 1, False)
            </Action>
        </Macro>
        <Macro Name="Macro 1" id="413">
            <Action>
                EventGhost.ShowOSD(u'short event', 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>
        </Macro>
        <Macro Name="Macro 2" id="409">
            <Action>
                EventGhost.ShowOSD(u'long event', 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>
        </Macro>
    </Folder>
</EventGhost>
Btw, In EG there are no event types such as "click", "longclick" or anything like that. There are only events and they may or may not have a duration. So only way to distinguish between a long and short press is to measure the time the event lasts yourself (that's basically what the above 3-macro example is doing).
matejdro
Posts: 38
Joined: Wed Jul 21, 2010 9:58 am

Re: Don't trigger click events when holding

Post by matejdro »

Damn, this is so confusing but yet so obvious.

Thank you!
Post Reply