Class Bindings

Inheritance Relationships

Derived Type

Class Documentation

class Bindings

Owns physical-to-semantic mappings.

Device notifications update pending physical state on the polling thread; publish_actions() commits one immutable result for a platform poll. Configuration and on_* calls belong to that same owner thread. Published handles may be read on other threads.

Subclassed by CE::Platform::GLFW::GainputMapper

Public Functions

BindingId bind_button(CE::Input::Control control, Id action)

Declaration: [[nodiscard]]

Bind one physical control to a semantic button on the polling owner.

Multiple mappings to one button action combine with OR. Conflicting button/axis use of an action is rejected.

Parameters:
  • control – Physical device and button identity.

  • action – Application-owned semantic identity read from tick input.

Returns:

Nonzero registration ID for later unbind().

BindingId bind_button(Chord chord, Id action)

Declaration: [[nodiscard]]

Bind an AND chord to a semantic button; alternative mappings combine with OR.

Empty chords and conflicting button/axis use of an action are rejected. Configuration belongs to the polling owner.

Parameters:
  • chord – Controls that must all be held in one poll.

  • action – Application-owned semantic button identity.

Returns:

Nonzero registration ID for later unbind().

BindingId bind_axis(CE::Input::Control axis, Id action, AxisOptions options = {})

Declaration: [[nodiscard]]

BindingId bind_axis(Chord modifiers, CE::Input::Control axis, Id action, AxisOptions options = {})

Declaration: [[nodiscard]]

bool unbind(BindingId binding)

Remove one mapping on the polling owner.

Removal affects the next publication; it does not erase already mapped relative activity or earlier immutable handles.

Parameters:

binding – Registration ID returned when the mapping was added.

Returns:

Whether an existing mapping was removed; unknown IDs return false.

void unbind_action(Id action)
void clear()
void set_device_enabled(CE::Input::DeviceId device, bool enabled)
void on_axis(CE::Input::Control binding, float value)
void on_delta(CE::Input::Control binding, float delta)
void on_button(CE::Input::Control binding, bool held)
std::shared_ptr<const Snapshot> publish_actions(std::chrono::steady_clock::time_point observed_at = std::chrono::steady_clock::now())

Declaration: [[nodiscard]]

std::shared_ptr<const Snapshot> action_snapshot() const

Declaration: [[nodiscard]]