Jump to content

*Request* button_mode=OffOnly


Marxon
 Share

Recommended Posts

Hello Marxon

i hope i undersand your question right...

try this as OFF in .NGC

EVENT_BUTTON id=  1  type=CC  chn= 1 cc= 16  range=  127:0

and this as ON

EVENT_BUTTON id=  1  type=CC  chn= 1 cc= 16  range=  0:127

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

Link to comment
Share on other sites

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

Edited by Marxon
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...