Skip to content

Button Events

Button Events include Pushes, Releases and Holds. These events are associated with a push or release on a particular device-channel.

  • A HOLD event handler specifies the actions that should be performed when a button is pressed and held for a minimum length of time indicated by the TIME parameter (specified in 0.1 second increments).
  • The REPEAT keyword is used to specify that the event notification should be repeated in TIME increments as long as the button is held.
  • The BUTTON object is available to the button event handler as a local variable.

The following table lists the information contained in Button Objects.

Button Objects

Property Name Type Description
Button.Input DEVCHAN Device + Channel
Button.Input.Channel INTEGER Channel
Button.Input.Device DEV Device
Button.Input.Device.Number INTEGER Device number
Button.Input.Device.Port INTEGER Device port
Button.Input.Device.System INTEGER System number
Button.Holdtime LONG Current hold time in one-millisecond (1 ms) increments
Button.SourceDev DEV Source device of button event
Button.SourceDev.Number INTEGER Source device number
Button.SourceDev.Port INTEGER Source device port
Button.SourceDev.System INTEGER Source device system.

If the event handler is specified using an array for DEV, CHANNEL, or a DEVCHAN array, GET_LAST can determine which index in the array caused the event to run.

Example

BUTTON_EVENT[DEVICE,CHANNEL] or
BUTTON_EVENT[(DEVCHAN[])]
{
    PUSH:
    {
        // PUSH event handler
    }
    RELEASE:
    {
        // RELEASE event handler
    }
    HOLD[TIME]: or HOLD[TIME, REPEAT]:
    {
        // HOLD event handler
    }
}

See Also