Marxon Posted September 2, 2015 Report Posted September 2, 2015 Hi TK, would you please add also a "OffOnly" mode for buttons? A way to start a ngr on button press and a other script on release would be just as helpfull. Thank you very much! Best regards Marxon
novski Posted September 2, 2015 Report Posted September 2, 2015 Hello Marxoni hope i undersand your question right...try this as OFF in .NGCEVENT_BUTTON id= 1 type=CC chn= 1 cc= 16 range= 127:0and this as ONEVENT_BUTTON id= 1 type=CC chn= 1 cc= 16 range= 0:127and to jump to .NGR section type this in .NGC: EVENT_BUTTON id=1 type=Meta meta=RunSection:21 button_mode=OnOnlyand make the corresponding section in .NGRif ^section == 21 endif i didn't test that, let me know if it helped...Best Regards, Novski
Marxon Posted September 2, 2015 Author Report Posted September 2, 2015 (edited) Hi Novski,thanks for your suggestion!Your inverted range get me on the right path.Last night I did not come up with the idea.This is working: ### BUTTON PRESS EVENT_BUTTON id=1 hw_id=3 type=Meta range=127:0 button_mode=OnOff meta=runsection:1 ### BUTTON RELEASE EVENT_BUTTON id=2 hw_id=3 type=Meta range=0:127 button_mode=OnOnly meta=runsection:2It allows to run two different scripts on button press and button release.Until now i used a if/then statement in my .NGR script wich was probably not very CPU friendly.### .NGC EVENT_BUTTON id=1 hw_id=1 type=Meta range=0:127 button_mode=OnOff meta=runsection:1 ### .NGR if ^section == 1 if (id)button:1 == 0 LOG "BUTTON RELEASE" else LOG "BUTTON PRESS" endif endif Best regardsMarxon Edited September 2, 2015 by Marxon
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now