C4 Engine
C4 Engine API Documentation

class ButtonControl

Defined in:  C4Input.h
Encapsulates a button input control.

class ButtonControl : public InputControl

The ButtonControl class is the base class for all input controls that are buttons.

If an action is assigned to a ButtonControl object, an internal counter for the action is incremented when the button is pressed, and it is decremented when the button is released. When the counter is incremented to 1, the action's Action::HandleEngage function is called, and when the counter is decremented to 0, the action's Action::HandleDisengage function is called. This mechanism allows an action to be assigned to multiple buttons without redundant events being reported.
Base Classes
InputControl A ButtonControl is a specific type of input control.
See Also