Change number box with key

Change number box with key

This example shows how you can increase or decrease the number in a number box each time the up or down arrow keys are pressed. The incdec object is made to be connected to the integer number box in the manner shown here. The messages inc and dec to incdec will increment and decrement the attached number box. So, here we detect the press of the up and down arrow keys, and trigger the inc and dec messages in response.

Chapter: 
Keywords: