Slider Keys

The goal of this example is to demonstrate how to use a slider control to trigger repeated keyboard keys as it is pushed. This assumes that the reader is familiar with the basics of creating Building Blocks as shown in the Detailed Tutorial.

This example will generate "+" and "–" keyboard keys when the slider on the CH Products CH Pro Throttle USB moves. When it is pushed away from the user, it will generate "+" keys. When it is pulled toward the user, it will generate "–" keys.

For this example, three types of building blocks are needed: an Axis building block that responds to the slider control, Delta (Strobe) building blocks to detect when the slider moves a certain distance, and Single Key building blocks to generate the keyboard keys.

The slider on the CH Pro Throttle USB is a Z-Axis control. To determine how the axis value changes as the slider is moved, an Axis building block for the Z-Axis is created. When the slider is pushed away from the user, the value of the Axis building block decreases. When the slider is pulled toward the user, the value increases.

The first step is to create two Range (Strobe) building blocks and connect them to an Axis building block for the Z-Axis.

Each Delta (Strobe) building block is configured to detect when the Z-Axis changes by a certain amount.

For example, the highlighted Delta (Strobe) block to the right will turn its output ON then OFF each time the Z-Axis value decreases by "5".


The next step is to create two Single Key building blocks and connect one to each of the Delta (Strobe) building blocks.

Each Single Key block is configured to generate the keyboard key that corresponds to the direction that its Delta (Strobe) block detects.

With building blocks configured in this manner, ControllerMate will generate "+" and "–" keys as the slider on the CH Products CH Pro Throttle USB moves. The speed at which the slider moves is irrelevant.