Building blocks are the basic unit of programming in ControllerMate. Each building block performs a task when it is triggered, then triggers all other blocks that are connected to it. A complex task can be created by linking a series of building blocks together.
Building blocks are created by dragging them from the Palette window to the Editor window, or by right-clicking in the contents of a page in the Editor window.
Building blocks are organized on Pages. A page can contain any number of building blocks, but it may be convenient to distribute a large number of blocks among several pages. The only requirement is that blocks need to be on the same page to connect to each other.
Most building blocks have options that affect their behavior. To configure a building block, select it in the Editor window and adjust its settings in the Inspector window. Multiple building blocks can be configured at the same time only if they have the same type.
Building blocks are linked to each other by connecting the output of one block to the input of another. Each block that can accept a value from another block has one or more inputs, each block that can send a value to another building block has one output. There are two types of input and output connections: ON/OFF connections and Number connections. An ON/OFF input needs to be connected to an ON/OFF output, and a Number input needs to be connected to a Number output. The two types of connections cannot be connected directly to one another, but there are a number of building blocks that can be used to convert one type of connection to the other (Range, Value Selector, Constant Number).
In the image below, the block on the left has an input that accepts an ON/OFF value. The block on the right has an input that accepts a number value. The type types of inputs have a different size and shape. Also in the image below, the block on the left has an ON/OFF output value. The block on the right has a Number output value. ON/OFF outputs are always green, Number outputs are always blue. Each type of output has a shape that is similar to the input that it can be attached to.
Building blocks may be connected either by positioning them such that an output overlaps an input, or by dragging an output value to an empty input.
When the value of a building block changes, it sends that new value to any blocks that are connected to its output. Those blocks may perform a function, perform a calculation, or combine the new value with other values to determine their own output values. If a block's output value changes, it will pass the new value on to any blocks that are connected to its output.
An output that is connected to one building block can be connected to others by dragging the output to additional inputs.
The following is an example of a very basic use of building blocks:
The first block (a Button building block) responds to Button #1 on a CH Fighterstick USB joystick. It turns its output ON when the button is pressed, and OFF when the button is released. The second block (a Text building block) generates text using ControllerMate's internal keyboard. When its input turns ON, it will generate the text "Hello" using ControllerMate's internal keyboard, then turn its output ON. This combination of building blocks causes ControllerMate to type "Hello" each time Button #1 on the CH Fighterstick USB is pressed.
This function can be expanded by adding a third building block:
The third block (a Beep building block) plays the current system alert sound. When its input turns ON, it will play the sound then turn its output ON. This second combination of building blocks causes ControllerMate to type "Hello" then play the system sound each time Button #1 on the CH Fighterstick USB is pressed.