# Custom Button

This button is similar to the Toggle Button, but supports multiple states and a variety of events within each state.

Events may include presets, schedules, or custom actions. When an event occurs within the current state, the button executes the associated function or action(s) and then either switches to the next specified state, or remains in the same state.

With this combination of states, events, and actions, you can easily design powerful, responsive context-sensitive behaviors in a single button without the need for complex coding or task scripting.

## Managing States

1. Click the Change button to load the Button Configuration window.

2. Click Add State to create as many states as needed, and configure the appearance of each state:

   - Name - a descriptive title displayed in this window and the Actions pane.

   - Background/Foreground/Text - the button color, button text color, and button text displayed when the state is active.

## Managing Events

1. With a state selected, click Add Event to select an event type.
   You can add multiple events of any type (except Button Click) to the same event.

   - Click Duplicate to make a copy of the selected event (except Button Click) in the same state.

   - Click Delete to remove the selected state or event.

   - Click and drag to move the event to another state (except Button Click if the target state already has one).

2. Configure the event’s properties (see below).

3. Click Ok to close the Button Configuration window when done.

You can also access the Action Editor for each event by clicking Edit in the Actions pane.

### Event Types

#### Button Click

Executes any included action(s) when user clicks the button in the Console.

Property | Description
--- | ---
Actions | Click Edit to open the Action Editor
Next state | Select a target state, or No change to remain in the current state

#### Preset

Changes the state when a matching Preset command is sent.

Property | Description
--- | ---
Next state | Select a target state, or No change to remain in the current state
Area selection type | Any area, or Specify the selected Area only
Area | If specified, only this area is monitored for preset commands
Join | The static join level (default: 0xFF) monitored for preset commands
Channel | All Channels (0) or a specific channel in the area to monitor for preset commands
Base Link Area | Only required if listening for Preset commands to a BLA that includes the specified area.
Preset selection type | Any, or Specify/Exclude the selected Preset only.
Preset | The preset command that triggers this event.
Follow preset offset | Inactive, do not adjust this property.

#### Current Preset

Changes the state when a matching Current Preset query is sent.

Property | Description
--- | ---
Next state | Select a target state, or No change to remain in the current state
Area selection type | Any area, or Specify the selected Area only
Area | If specified, only this area is monitored for Current Preset queries
Join | The static join level (default: 0xFF) monitored for Current Preset queries
Base Link Area | Only required if listening for Current Preset queries to a BLA that includes the specified area.

#### Panic

Changes the state when a matching Panic command is sent.

Property | Description
--- | ---
Next state | Select a target state, or No change to remain in the current state
Area selection type | Any area, or Specify the selected Area only
Area | If specified, only this area is monitored for Panic commands
Join | The static join level (default: 0xFF) monitored for Panic commands
Base Link Area | Only required if listening for Panic commands to a BLA that includes the specified area.
Activate Reset | Select which Panic command triggers the event (Activate or Reset)

#### Schedule Start

Changes the state when the selected schedule begins.

Property | Description
--- | ---
Next state | Select a target state, or No change to remain in the current state
Schedule | Select a schedule to trigger this event.

#### Schedule Stop

Changes the state when the selected schedule stops.

Property | Description
--- | ---
Next state | Select a target state, or No change to remain in the current state
Schedule | Select a schedule to trigger this event.

#### Schedule Tick

Changes the state every time a repeating Timed Event schedule occurs between its Start and Stop times.

Property | Description
--- | ---
Next state | Select a target state, or No change to remain in the current state
Schedule | Select a schedule to trigger this event.