Contents

NSButton.ButtonType.multiLevelAccelerator

A button that allows for a configurable number of stepped pressure levels and provides tactile feedback as the user reaches each step.

Declaration

case multiLevelAccelerator

Discussion

Use maxAcceleratorLevel to configure the number of pressure levels. For other types of buttons, this property value defaults to 1. For multilevel accelerator buttons, this property value defaults to 2, and you can set it to a value between 1 and 5.

Like a normal accelerator button, the button sends an action when the user first clicks it. If isContinuous is true, while the user clicks the button, it then sends actions at repeating intervals that are based on pressure. If isContinuous is false, the button sends actions as the user presses harder and reaches different levels of pressure. The button sends a final action when the user releases the button.

The value of a multilevel accelerator button is distinct from its state. The integerValue of a multilevel button is 0 when the user doesn’t click it or 1 through 5 when the user clicks it, depending on the level of pressure. If you set the value of a multilevel accelerator button explicitly, the button doesn’t send an action until pressure reaches the level you specify.

On a system that doesn’t support pressure sensitivity, a multilevel accelerator button’s value is always 1 when the user clicks it.

This option corresponds to the Multi Level Accelerator type in Interface Builder’s Attributes inspector.

See Also

Configuring Button Behavior