*Request* button_mode=OffOnly

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

Hello Marxon

i hope i undersand your question right…

try this as OFF in .NGC

<tt>EVENT_BUTTON id= 1 type=CC chn= 1 cc= 16 range= 127:0</tt>

and this as ON

<tt>EVENT_BUTTON id= 1 type=CC chn= 1 cc= 16 range= 0:127</tt>

and to jump to .NGR section type this in .NGC:

EVENT_BUTTON id=1 type=Meta meta=RunSection:21 button_mode=OnOnly

and make the corresponding section in .NGR

if ^section == 21

endif

i didn’t test that, let me know if it helped…

Best Regards, Novski

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:2

It 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 regards
Marxon