Struct Control

Struct Documentation

struct Control

Physical (device, control) identity for bindings.

Initialize both fields before using a default-initialized Control; no device lifetime is retained. Typed constructors accept only supported control enums; unrelated enums are deleted.

Public Functions

constexpr Control() = default

Default construction supplies no explicit member values; initialize device/control before querying or binding.

inline constexpr Control(const DeviceId device, const ControlId control) noexcept

Store raw tokens without validation.

Binding evaluation later validates control identities; this value does not own a device.

inline constexpr Control(const DeviceId device, const KeyboardKey key) noexcept

Store device with control_id(key); Unknown becomes invalid_control for later rejection.

inline constexpr Control(const DeviceId device, const MouseButton button) noexcept

Store device with control_id(button), independently of native mouse SDK tokens.

inline constexpr Control(const DeviceId device, const GamepadControl gamepad) noexcept

Store device with control_id(gamepad); the named control may still be unavailable on that device.

template<typename Enum>
Control(DeviceId, Enum) = delete

Requires: std::is_enum_v<Enum>

inline bool operator==(const Control &o) const

Compare both physical tokens by value; neither device availability nor current held state is queried.

Public Members

DeviceId device

Adapter-owned device token.

ControlId control

Portable or adapter extension control token; invalid_control is rejected by binding APIs.