Posts: 3
Threads: 1
Joined: Feb 2016
Reputation:
0
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.
Posts: 7839
Threads: 42
Joined: Jun 2015
Reputation:
450
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.
Posts: 1773
Threads: 6
Joined: Jul 2015
Reputation:
118
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