This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Trigger an event when button is pressed down but not released
#1
Hi all, I am fairly new in scripting using lua but I am quite experienced in other programming languages. I find it hard to determine how I can trigger an event after pressing down a button. I see that events are triggered after release of the button which means, event is triggered on Rising Edge of the button data. Can any body tell me if what I intend to do is possible?
Thank you in advance for your help.
Reply
#2
Depends on how your button is configured. Most physical button inputs have rising (on) and falling (off) edge detection. You can set a fixed value to both actions, so in your script you can use event.getvalue() to figure out if button is pressed or released.
Reply
#3
(05.02.2016, 17:56)admin Wrote: Depends on how your button is configured. Most physical button inputs have rising (on) and falling (off) edge detection. You can set a fixed value to both actions, so in your script you can use event.getvalue() to figure out if button is pressed or released.
Hi admin, thanks for the quick reply! unfortunately, I am using a button in SpaceLynk, not a an actual physical button. And I can't find the right material to instruct me how to set the trigger of the button to either an risin or falling trigger. Right now, as observed, events are only triggered after button released.
Reply
#4
Hi Sniper,

Currently there is only 1 event  (on release) in spaceLYnk, i discussed this with the
DEV team to add a extra event in future FW. This way we could use long/short press etcetera.

As far as i know it's not implemented yet (and also not confirmed that it will be added)
but it could be possible with Javascript in new FW. I didn't try to create this but i think 
we could create your wanted feature with it.

I hope (just like you) we have 2 events on button in one of the upcomming FW version.. 

BR,

Erwin van der Zwart
Reply
#5
(06.02.2016, 19:14)Erwin van der Zwart Wrote: Hi Sniper,

Currently there is only 1 event  (on release) in spaceLYnk, i discussed this with the
DEV team to add a extra event in future FW. This way we could use long/short press etcetera.

As far as i know it's not implemented yet (and also not confirmed that it will be added)
but it could be possible with Javascript in new FW. I didn't try to create this but i think 
we could create your wanted feature with it.

I hope (just like you) we have 2 events on button in one of the upcomming FW version.. 

BR,

Erwin van der Zwart


Hi Erwin,
    Thanks for your reply. Now I have confirmation that it was not supported. However, do you know any variable or group address that changes when the button is pressed? We may be able to track its status and have it be the trigger for our event. So far, I have not found any. And I think I might go with your suggestion to use Javascript. 

    Thanks!
Reply


Forum Jump: