InputDevice::GetFirstInputControl
Defined in:
Returns the first control belonging to an input device.
C4Input.h
Prototype
InputControl *GetFirstInputControl(void) const;
Description
The GetFirstInputControl
function returns a pointer to the first input control belonging to an input device. All input devices have at least one input control, so the return value is never nullptr
.Input controls are organized into a tree structure. All of the input controls belonging to an input device can be retrieved by calling the
GetFirstInputControl
function function and then repeatedly calling the InputDevice::GetNextInputControl
function as shown in the following code.
InputControl *control = device->GetFirstInputControl();
do
{
...
control = device->GetNextInputControl(control);
} while (control);
do
{
...
control = device->GetNextInputControl(control);
} while (control);
See Also