Toast Engine
Loading...
Searching...
No Matches
input::Bind Class Reference

Binds a single keycode to its triggers and per-bind modifiers. More...

#include <bind.hpp>

Classes

struct  Result
 Outcome of evaluating a bind for one frame. More...

Public Member Functions

auto evaluate (const InputSample &sample, const EvalContext &ctx) -> Result
 Evaluates every trigger and applies per-bind modifiers.
auto keycode () const noexcept -> const KeyCode &
auto keycodeString () const noexcept -> std::string_view

Static Public Member Functions

static auto fromToml (const toml::table &table, ValueType vt) -> Bind
 Builds a bind from a [[bind]] TOML table.

Detailed Description

Binds a single keycode to its triggers and per-bind modifiers.

Member Function Documentation

◆ evaluate()

auto input::Bind::evaluate ( const InputSample & sample,
const EvalContext & ctx ) -> Result

Evaluates every trigger and applies per-bind modifiers.

Parameters
sampleThe raw input for this bind's keycode this frame
ctxFrame context
Returns
The bind's contribution and the events its triggers fired

◆ fromToml()

auto input::Bind::fromToml ( const toml::table & table,
ValueType vt ) -> Bind
static

Builds a bind from a [[bind]] TOML table.

Parameters
tableThe bind table holding keycode, triggers and modifiers
vtThe value domain of the owning action
Returns
The constructed bind
Here is the caller graph for this function:

◆ keycode()

auto input::Bind::keycode ( ) const -> const KeyCode &
inlinenodiscardnoexcept
Returns
The parsed keycode this bind reads

◆ keycodeString()

auto input::Bind::keycodeString ( ) const -> std::string_view
inlinenodiscardnoexcept
Returns
The original keycode string

The documentation for this class was generated from the following files:
  • engine/src/toast/input/bind.hpp
  • engine/src/toast/input/bind.cpp