Increase values as long as button is pressed

Moderator: Moderator Group

Increase values as long as button is pressed

Postby pianist » Sun Apr 03, 2016 7:38 pm

I want to increase a value with an increment of 0.1 as long as a joystick button is pressed so the resulting number is accumulating. How do I accomplish this? It's very simple if using a keyboard shortcut - then the value just increases continuously as long as you hold the key pressed. How to achieve the same behaviour with the joystick button?

I have a very simple custom script node with a variable, MasterTemp:

If 152Button8 > 0 then

True Script
MasterTemp += 0.1

And this works fine - however only increasing 0.1 per click.
pianist
 
Posts: 29
Joined: Mon Mar 30, 2015 1:02 pm

Re: Increase values as long as button is pressed

Postby Christian Hinxlage » Mon Apr 04, 2016 11:23 am

Hi,

send your command " MasterTemp += 0.1 " via a script timer. Here additionally you can type in the interval the value of your variable should increase.
With the joystick button just send the start and stop commands for the script timer via a script output node.

Best regards

Christian
Christian Hinxlage
Technical Support Manager

Christie Digital Systems Canada Inc.
www.christiedigital.com
User avatar
Christian Hinxlage
Site Admin
 
Posts: 78
Joined: Wed Jul 22, 2015 9:58 pm

Re: Increase values as long as button is pressed

Postby pianist » Mon Apr 04, 2016 11:51 am

Excellent - thank you!
pianist
 
Posts: 29
Joined: Mon Mar 30, 2015 1:02 pm


Return to Widget Designer V4.7

Who is online

Users browsing this forum: No registered users and 25 guests

cron