Go to the documentation of this file.
9 #ifndef EAGINE_APPLICATION_INPUT_HPP
10 #define EAGINE_APPLICATION_INPUT_HPP
12 #include "../bitfield.hpp"
13 #include "../callable_ref.hpp"
14 #include "../message_id.hpp"
15 #include "../value_with_history.hpp"
67 : signal_id{std::move(sig_id)}
113 _value_kinds = all_input_value_kinds();
119 return _value_kinds.
has(kind);
130 auto invert(
bool init =
true) noexcept -> auto& {
143 return _invert ? -_multiplier : _multiplier;
156 return !_only_if || *_only_if;
160 double _multiplier{1.0};
161 bool* _only_if{
nullptr};
170 template <
typename T>
176 [&](
auto elem) {
return double(setup.
multiplier() * elem); },
180 explicit operator bool() const noexcept {
181 return !are_equal(this->
get(), 0.0);
192 using base = std::tuple<message_id, input_handler>;
196 auto id() const noexcept -> auto& {
197 return std::get<0>(*
this);
202 return std::get<1>(*
this);
Application harness / wrapper code is placed in this namespace.
Definition: eagine.hpp:72
@ absolute_norm
Absolute input value normalized to <-1, 1>.
Declaration of class template storing a reference to a callable object.
Definition: callable_ref.hpp:24
auto value() const noexcept
Returns the current revision of the value.
Definition: value_with_history.hpp:165
input_value_kind
Application input value kind bits enumeration.
Definition: input.hpp:22
constexpr auto has(bit_type bit) const noexcept
Tests if the specified bit is set.
Definition: bitfield.hpp:70
Class for read-only values with history.
Definition: value_with_history.hpp:141
bitfield< input_value_kind > input_value_kinds
Application input value kind bitfield.
Definition: input.hpp:34
@ relative
Relative input value change.
auto get() const noexcept
Returns the current revision of the value.
Definition: value_with_history.hpp:158
Class storing two identifier values representing class/method pair.
Definition: message_id.hpp:25
@ absolute_free
Absolute input value without bounds.
Class for mutable variables with history.
Definition: value_with_history.hpp:291