|
GREM 3.12.0
Game/Rendering Engine Modules for C++
|
System for mapping physical Input controls to abstract output numbers and processing input events that control their associated values. More...
#include <GREM/events/InputManager.hpp>
Classes | |
| struct | ControlState |
| State value of a control associated with some input(s) and/or output(s). More... | |
| struct | ControlState2D |
| State value of a 2-dimensional control associated with some input(s) and/or output(s). More... | |
| struct | ControlState3D |
| State value of a 3-dimensional control associated with some input(s) and/or output(s). More... | |
| struct | ControlDelta |
| Relative change of the state value between frames of a control associated with some input(s) and/or output(s). More... | |
| struct | ControlDelta2D |
| Relative change of the state value between frames of a 2-dimensional control associated with some input(s) and/or output(s). More... | |
| struct | ControlDelta3D |
| Relative change of the state value between frames of a 3-dimensional control associated with some input(s) and/or output(s). More... | |
| class | OutputEventBase |
| Output event base. More... | |
| struct | OutputMoved |
| Output value changed. More... | |
| struct | OutputPressed |
| Output was pressed. More... | |
| struct | OutputReleased |
| Output was released. More... | |
| struct | OutputEvent |
| Data structure containing information about an output event. More... | |
| struct | Binding |
| A single configured binding from a physical input to a set of abstract output numbers. More... | |
Public Types | |
| using | OutputIndex = uint8_t |
| Abstract output number. | |
Public Member Functions | |
| InputManager () | |
| Construct an input manager with the default options. | |
| InputManager (const InputManagerOptions &options) | |
| Construct an input manager. | |
| void | loadConfiguration (String fileContents, CStringView filepath, FunctionView< Optional< OutputIndex >(StringView actionName)> getOutputIndex, FunctionView< void(StringView key, json::Reader &reader)> readExtraProperty=[](StringView, json::Reader &) -> void {}) |
| Apply the configuration specified in a JSON configuration file, adding to the previous bindings if any already existed for the same inputs. | |
| void | loadConfiguration (String fileContents, FunctionView< Optional< OutputIndex >(StringView actionName)> getOutputIndex, FunctionView< void(StringView key, json::Reader &reader)> readExtraProperty=[](StringView, json::Reader &) -> void {}) |
| Apply the configuration specified in a JSON configuration file, adding to the previous bindings if any already existed for the same inputs. | |
| template<enumeration Action> | |
| void | loadConfiguration (String fileContents, CStringView filepath={}, FunctionView< void(StringView key, json::Reader &reader)> readExtraProperty=[](StringView, json::Reader &) -> void {}) |
| Apply the configuration specified in a JSON configuration file, assuming a set of abstract output numbers associated with a given enum type, adding to the previous bindings if any already existed for the same inputs. | |
| void | loadConfiguration (const Filesystem &filesystem, CStringView filepath, FunctionView< Optional< OutputIndex >(StringView actionName)> getOutputIndex, FunctionView< void(StringView key, json::Reader &reader)> readExtraProperty=[](StringView, json::Reader &) -> void {}) |
| Apply the configuration specified in a JSON configuration file, adding to the previous bindings if any already existed for the same inputs. | |
| template<enumeration Action> | |
| void | loadConfiguration (const Filesystem &filesystem, CStringView filepath, FunctionView< void(StringView key, json::Reader &reader)> readExtraProperty=[](StringView, json::Reader &) -> void {}) |
| Apply the configuration specified in a JSON configuration file, assuming a set of abstract output numbers associated with a given enum type, adding to the previous bindings if any already existed for the same inputs. | |
| String | saveConfiguration (FunctionView< Optional< String >(OutputIndex outputIndex)> getActionName, Span< const Pair< StringView, json::Variant > > extraProperties={}) const |
| Save the current preferences and bindings to a JSON configuration string. | |
| template<enumeration Action> | |
| String | saveConfiguration (Span< const Pair< StringView, json::Variant > > extraProperties={}) const |
| Save the current preferences and bindings to a JSON configuration string for a set of abstract output numbers. | |
| void | saveConfiguration (Filesystem &filesystem, CStringView filepath, FunctionView< Optional< String >(OutputIndex outputIndex)> getActionName, Span< const Pair< StringView, json::Variant > > extraProperties={}) const |
| Save the current preferences and bindings to a JSON configuration file. | |
| template<enumeration Action> | |
| void | saveConfiguration (Filesystem &filesystem, CStringView filepath, Span< const Pair< StringView, json::Variant > > extraProperties={}) const |
| Save the current preferences and bindings to a JSON configuration file for a set of abstract output numbers. | |
| void | update () |
| Advance the internal state to the next frame of inputs. | |
| void | handleEvent (const Event &event) |
| Handle an event from an EventPump, which may cause updates to the internal input/output state of the current frame. | |
| Span< const OutputEvent > | pollOutputEvents () |
| Poll events from the input manager and update the internal event buffer. | |
| GREM_ALWAYS_INLINE Span< const OutputEvent > | getLatestPolledOutputEvents () const noexcept |
| Get the latest output events in the internal event buffer that occured since the last call to pollOutputEvents(). | |
| void | bind (Input input, ArrayList< OutputIndex > outputIndices) |
| Bind a physical input to a set of abstract output numbers, overriding the previous binding if one already existed for the same input. | |
| void | addBindings (Input input, Span< const OutputIndex > outputIndices) |
| Bind a physical input to a set of abstract output numbers, adding to the previous binding if one already existed for the same input. | |
| GREM_ALWAYS_INLINE void | addBinding (Input input, OutputIndex outputIndex) |
| Bind a physical input to an abstract output number, adding to the previous binding if one already existed for the same input. | |
| void | unbind (Input input) noexcept |
| Remove all bindings from a specific input. | |
| void | unbindAll () noexcept |
| Remove all bindings from all inputs. | |
| void | resetAllStates () noexcept |
| Reset the states of all inputs and outputs for the current and previous frames, and clear all polled and pending events. | |
| void | setCurrentState (TimePoint timestamp, Input input, ControlState newState) |
| Set the contribution of an input to its bound outputs to a new state. | |
| void | setCurrentState (TimePoint timestamp, OutputIndex outputIndex, ControlState newState) |
| Set the external contribution to an output to a new state. | |
| template<enumeration Action> requires (!same_as<Action, Input> && !same_as<Action, OutputIndex>) | |
| GREM_ALWAYS_INLINE void | setCurrentState (TimePoint timestamp, Action action, ControlState newState={.activePresses=1,.value=1.0f}) |
| Like setCurrentState(TimePoint, OutputIndex, ControlState), but accepts an "action" of any enum type, which is interpreted as corresponding to the output number equal to its underlying value. | |
| void | addRelativeState (TimePoint timestamp, Input input, ControlDelta delta) |
| Apply a relative offset to the contribution of an input to its bound outputs for this frame only. | |
| void | addRelativeState (TimePoint timestamp, OutputIndex outputIndex, ControlDelta delta) |
| Apply a relative offset to the external contribution to an output for this frame only. | |
| template<enumeration Action> requires (!same_as<Action, Input> && !same_as<Action, OutputIndex>) | |
| GREM_ALWAYS_INLINE void | addRelativeState (TimePoint timestamp, Action action, ControlDelta delta) |
| Like addRelativeState(TimePoint, OutputIndex, ControlDelta), but accepts an "action" of any enum type, which is interpreted as corresponding to the output number equal to its underlying value. | |
| void | releaseAll (TimePoint timestamp) |
| Release all currently held inputs and outputs for the current frame, reset the positions of all inputs, and reset the contributions of all inputs and outputs to 0. | |
| GREM_ALWAYS_INLINE void | setPreferences (const InputManagerPreferences &preferences) noexcept |
| Set the user preferences of the input manager. | |
| GREM_ALWAYS_INLINE void | setEmitOutputEvents (bool emitOutputEvents) noexcept |
| Set whether output events should be emitted or not. | |
| GREM_ALWAYS_INLINE const InputManagerPreferences & | getPreferences () const noexcept |
| Get the current user preferences of the input manager. | |
| GREM_ALWAYS_INLINE const InputManagerPreferences & | getInitialPreferences () const noexcept |
| Get the initial user preferences of the input manager. | |
| GREM_ALWAYS_INLINE const InputManagerOptions & | getOptions () const noexcept |
| Get the current configuration options of the input manager. | |
| GREM_ALWAYS_INLINE bool | hasAnyBindings () const noexcept |
| Check if this input manager has any active bindings for any input. | |
| Allocation< Binding > | getBindings () const |
| Get all active bindings of this input manager. | |
| Span< const OutputIndex > | getBoundOutputs (Input input) const noexcept |
| Get the set of outputs that a specific input is currently bound to. | |
| Span< const Input > | getBoundInputs (OutputIndex outputIndex) const noexcept |
| Get the set of inputs that are bound to a specific output. | |
| template<enumeration Action> requires (!same_as<Action, Input> && !same_as<Action, OutputIndex>) | |
| GREM_ALWAYS_INLINE Span< const Input > | getBoundInputs (Action action) const noexcept |
| Like getBoundInputs(OutputIndex) const noexcept, but accepts an "action" of any enum type, which is interpreted as corresponding to the output number equal to its underlying value. | |
| GREM_ALWAYS_INLINE Optional< vec2 > | getCurrentMousePosition () const noexcept |
| Get the latest known mouse position processed by the input manager. | |
| GREM_ALWAYS_INLINE Optional< vec2 > | getPreviousMousePosition () const noexcept |
| Get the second last known mouse position processed by the input manager. | |
| GREM_ALWAYS_INLINE Optional< vec2 > | getRelativeMouseMotion () const noexcept |
| Get the relative motion between the last two known mouse positions processed by the input manager. | |
| GREM_ALWAYS_INLINE bool | mouseJustMoved () const noexcept |
| Check if the mouse just moved on the current frame. | |
| GREM_ALWAYS_INLINE vec2 | getRelativeMouseWheelScroll () const noexcept |
| Get the relative distance scrolled horizontally by the mouse wheel in the last frame processed by the input manager. | |
| GREM_ALWAYS_INLINE bool | mouseWheelJustScrolledHorizontally () const noexcept |
| Check if the mouse wheel was just scrolled horizontally on the current frame. | |
| GREM_ALWAYS_INLINE bool | mouseWheelJustScrolledVertically () const noexcept |
| Check if the mouse wheel was just scrolled vertically on the current frame. | |
| GREM_ALWAYS_INLINE Optional< vec2 > | getCurrentTouchPosition () const noexcept |
| Get the latest known touch finger position processed by the input manager. | |
| GREM_ALWAYS_INLINE Optional< vec2 > | getPreviousTouchPosition () const noexcept |
| Get the second last known touch finger position processed by the input manager. | |
| GREM_ALWAYS_INLINE Optional< vec2 > | getRelativeTouchMotion () const noexcept |
| Get the relative motion between the last two known touch finger positions processed by the input manager. | |
| GREM_ALWAYS_INLINE bool | touchJustMoved () const noexcept |
| Check if the touch finger just moved on the current frame. | |
| GREM_ALWAYS_INLINE Optional< float > | getCurrentTouchPressure () const noexcept |
| Get the latest known touch finger pressure processed by the input manager. | |
| GREM_ALWAYS_INLINE Optional< float > | getPreviousTouchPressure () const noexcept |
| Get the second last known touch finger pressure processed by the input manager. | |
| GREM_ALWAYS_INLINE Optional< float > | getRelativeTouchPressure () const noexcept |
| Get the relative pressure between the last two known touch finger pressures processed by the input manager. | |
| GREM_ALWAYS_INLINE bool | touchJustChangedPressure () const noexcept |
| Check if the touch finger just changed pressure on the current frame. | |
| GREM_ALWAYS_INLINE float | getRelativePinchScale () const noexcept |
| Get the relative scale performed by finger pinch in the last frame processed by the input manager. | |
| GREM_ALWAYS_INLINE bool | pinchJustScaled () const noexcept |
| Check if finger pinch was just performed on the current frame. | |
| GREM_ALWAYS_INLINE Optional< i16vec2 > | getCurrentControllerLeftStickPosition () const noexcept |
| Get the latest known position of the left analog stick of the connected controller, if there is one. | |
| GREM_ALWAYS_INLINE Optional< i16vec2 > | getPreviousControllerLeftStickPosition () const noexcept |
| Get the second last known position of the left analog stick of the connected controller, if there is one. | |
| GREM_ALWAYS_INLINE Optional< i32vec2 > | getRelativeControllerLeftStickMotion () const noexcept |
| Get the relative motion between the last two known positions of the left analog stick of the connected controller, if there is one. | |
| GREM_ALWAYS_INLINE bool | controllerLeftStickJustMoved () const noexcept |
| Check if the controller left analog stick just moved on the current frame. | |
| GREM_ALWAYS_INLINE Optional< i16vec2 > | getCurrentControllerRightStickPosition () const noexcept |
| Get the latest known position of the right analog stick of the connected controller, if there is one. | |
| GREM_ALWAYS_INLINE Optional< i16vec2 > | getPreviousControllerRightStickPosition () const noexcept |
| Get the second last known position of the right analog stick of the connected controller, if there is one. | |
| GREM_ALWAYS_INLINE Optional< i32vec2 > | getRelativeControllerRightStickMotion () const noexcept |
| Get the relative motion between the last two known positions of the right analog stick of the connected controller, if there is one. | |
| GREM_ALWAYS_INLINE bool | controllerRightStickJustMoved () const noexcept |
| Check if the controller right analog stick just moved on the current frame. | |
| GREM_ALWAYS_INLINE Optional< int16_t > | getCurrentControllerLeftTriggerPosition () const noexcept |
| Get the latest known position of the left trigger of the connected controller, if there is one. | |
| GREM_ALWAYS_INLINE Optional< int16_t > | getPreviousControllerLeftTriggerPosition () const noexcept |
| Get the second last known position of the left trigger of the connected controller, if there is one. | |
| GREM_ALWAYS_INLINE Optional< int32_t > | getRelativeControllerLeftTriggerMotion () const noexcept |
| Get the relative motion between the last two known positions of the left trigger of the connected controller, if there is one. | |
| GREM_ALWAYS_INLINE bool | controllerLeftTriggerJustMoved () const noexcept |
| Check if the controller left trigger just moved on the current frame. | |
| GREM_ALWAYS_INLINE Optional< int16_t > | getCurrentControllerRightTriggerPosition () const noexcept |
| Get the latest known position of the right trigger of the connected controller, if there is one. | |
| GREM_ALWAYS_INLINE Optional< int16_t > | getPreviousControllerRightTriggerPosition () const noexcept |
| Get the second last known position of the right trigger of the connected controller, if there is one. | |
| GREM_ALWAYS_INLINE Optional< int32_t > | getRelativeControllerRightTriggerMotion () const noexcept |
| Get the relative motion between the last two known positions of the right trigger of the connected controller, if there is one. | |
| GREM_ALWAYS_INLINE bool | controllerRightTriggerJustMoved () const noexcept |
| Check if the controller right trigger just moved on the current frame. | |
| GREM_ALWAYS_INLINE bool | isPressed (OutputIndex outputIndex) const noexcept |
| Check if a specific output is currently pressed, i.e. if its contributions from all of its bound inputs and external sources sum up to a value greater than 0. | |
| GREM_ALWAYS_INLINE bool | wasPreviouslyPressed (OutputIndex outputIndex) const noexcept |
| Check if a specific output was pressed on the previous frame, i.e. if its contributions from all of its bound inputs and external sources summed up to a value greater than 0. | |
| GREM_ALWAYS_INLINE bool | justPressed (OutputIndex outputIndex) const noexcept |
| Check if a specific output had a press triggered on the current frame. | |
| GREM_ALWAYS_INLINE bool | justReleased (OutputIndex outputIndex) const noexcept |
| Check if a specific output had a release triggered on the current frame. | |
| ControlState | getCurrentState (OutputIndex outputIndex) const noexcept |
| Get the current total absolute state of a specific output, which consists of the accumulated contributions from all of its bound inputs. | |
| ControlState | getPreviousState (OutputIndex outputIndex) const noexcept |
| Get the previous total absolute value of a specific output, which consists of the accumulated contributions from all of its bound inputs. | |
| ControlDelta | getRelativeState (OutputIndex outputIndex) const noexcept |
| Get the total relative delta of a specific output, which consists of the accumulated contributions from all of its bound inputs. | |
| ControlState | getCurrentState1D (OutputIndex outputNegative, OutputIndex outputPositive) const noexcept |
| Get the current combined absolute state of two specific outputs along one axis, which consists of the accumulated contributions from all of their bound inputs. | |
| ControlState | getPreviousState1D (OutputIndex outputNegative, OutputIndex outputPositive) const noexcept |
| Get the previous combined absolute state of two specific outputs along one axis, which consists of the accumulated contributions from all of their bound inputs. | |
| ControlDelta | getRelativeState1D (OutputIndex outputNegative, OutputIndex outputPositive) const noexcept |
| Get the combined relative delta of two specific outputs along one axis, which consists of the accumulated contributions from all of their bound inputs. | |
| ControlState2D | getCurrentState2D (OutputIndex outputNegativeX, OutputIndex outputPositiveX, OutputIndex outputNegativeY, OutputIndex outputPositiveY) const noexcept |
| Get the current combined absolute state of four specific outputs along two orthogonal axes, which consists of the accumulated contributions from all of their bound inputs. | |
| ControlState2D | getPreviousState2D (OutputIndex outputNegativeX, OutputIndex outputPositiveX, OutputIndex outputNegativeY, OutputIndex outputPositiveY) const noexcept |
| Get the previous combined absolute state of four specific outputs along two orthogonal axes, which consists of the accumulated contributions from all of their bound inputs. | |
| ControlDelta2D | getRelativeState2D (OutputIndex outputNegativeX, OutputIndex outputPositiveX, OutputIndex outputNegativeY, OutputIndex outputPositiveY) const noexcept |
| Get the combined relative delta of four specific outputs along two orthogonal axes, which consists of the accumulated contributions from all of their bound inputs. | |
| ControlState3D | getCurrentState3D (OutputIndex outputNegativeX, OutputIndex outputPositiveX, OutputIndex outputNegativeY, OutputIndex outputPositiveY, OutputIndex outputNegativeZ, OutputIndex outputPositiveZ) const noexcept |
| Get the current combined absolute state of six specific outputs along three orthogonal axes, which consists of the accumulated contributions from all of their bound inputs. | |
| ControlState3D | getPreviousState3D (OutputIndex outputNegativeX, OutputIndex outputPositiveX, OutputIndex outputNegativeY, OutputIndex outputPositiveY, OutputIndex outputNegativeZ, OutputIndex outputPositiveZ) const noexcept |
| Get the previous combined absolute state of six specific outputs along three orthogonal axes, which consists of the accumulated contributions from all of their bound inputs. | |
| ControlDelta3D | getRelativeState3D (OutputIndex outputNegativeX, OutputIndex outputPositiveX, OutputIndex outputNegativeY, OutputIndex outputPositiveY, OutputIndex outputNegativeZ, OutputIndex outputPositiveZ) const noexcept |
| Get the combined relative delta of six specific outputs along three orthogonal axes, which consists of the accumulated contributions from all of their bound inputs. | |
| GREM_ALWAYS_INLINE bool | isPressed (Input input) const noexcept |
| Check if a specific input is currently in a pressed state. | |
| GREM_ALWAYS_INLINE bool | wasPreviouslyPressed (Input input) const noexcept |
| Check if a specific input was in a pressed state on the previous frame. | |
| GREM_ALWAYS_INLINE bool | justPressed (Input input) const noexcept |
| Check if a specific input had a press triggered on the current frame. | |
| GREM_ALWAYS_INLINE bool | justReleased (Input input) const noexcept |
| Check if a specific input had a release triggered on the current frame. | |
| GREM_ALWAYS_INLINE ControlState | getCurrentState (Input input) const noexcept |
| Get the current absolute value of a specific input. | |
| GREM_ALWAYS_INLINE ControlState | getPreviousState (Input input) const noexcept |
| Get the previous absolute value of a specific input. | |
| GREM_ALWAYS_INLINE ControlDelta | getRelativeState (Input input) const noexcept |
| Get the relative delta of a specific input. | |
| GREM_ALWAYS_INLINE ControlState | getCurrentState1D (Input inputNegative, Input inputPositive) const noexcept |
| Get the current combined absolute state of two specific inputs along one axis. | |
| GREM_ALWAYS_INLINE ControlState | getPreviousState1D (Input inputNegative, Input inputPositive) const noexcept |
| Get the previous combined absolute state of two specific inputs along one axis. | |
| GREM_ALWAYS_INLINE ControlDelta | getRelativeState1D (Input inputNegative, Input inputPositive) const noexcept |
| Get the combined relative delta of two specific inputs along one axis. | |
| ControlState2D | getCurrentState2D (Input inputNegativeX, Input inputPositiveX, Input inputNegativeY, Input inputPositiveY) const noexcept |
| Get the current combined absolute state of four specific inputs along two orthogonal axes. | |
| ControlState2D | getPreviousState2D (Input inputNegativeX, Input inputPositiveX, Input inputNegativeY, Input inputPositiveY) const noexcept |
| Get the previous combined absolute state of four specific inputs along two orthogonal axes. | |
| ControlDelta2D | getRelativeState2D (Input inputNegativeX, Input inputPositiveX, Input inputNegativeY, Input inputPositiveY) const noexcept |
| Get the combined relative delta of four specific inputs along two orthogonal axes. | |
| ControlState3D | getCurrentState3D (Input inputNegativeX, Input inputPositiveX, Input inputNegativeY, Input inputPositiveY, Input inputNegativeZ, Input inputPositiveZ) const noexcept |
| Get the current combined scaled absolute value of six specific inputs along three orthogonal axes. | |
| ControlState3D | getPreviousState3D (Input inputNegativeX, Input inputPositiveX, Input inputNegativeY, Input inputPositiveY, Input inputNegativeZ, Input inputPositiveZ) const noexcept |
| Get the previous combined scaled absolute value of six specific inputs along three orthogonal axes. | |
| ControlDelta3D | getRelativeState3D (Input inputNegativeX, Input inputPositiveX, Input inputNegativeY, Input inputPositiveY, Input inputNegativeZ, Input inputPositiveZ) const noexcept |
| Get the current combined scaled relative value of six specific outputs along three orthogonal axes. | |
| template<enumeration... Actions> requires ((!same_as<Actions, Input> && !same_as<Actions, OutputIndex>) && ...) | |
| GREM_ALWAYS_INLINE void | bind (Input input, Actions... actions) |
| Like bind(Input, ArrayList<OutputIndex>), but accepts a pack of "actions" of any enum type, which are interpreted as corresponding to the output numbers equal to their underlying values. | |
| template<enumeration Action> requires (!same_as<Action, Input> && !same_as<Action, OutputIndex>) | |
| GREM_ALWAYS_INLINE void | addBinding (Input input, Action action) |
| Like addBinding(Input, OutputIndex), but accepts a pack of "actions" of any enum type, which are interpreted as corresponding to the output numbers equal to their underlying values. | |
| template<enumeration... Actions> requires ((!same_as<Actions, Input> && !same_as<Actions, OutputIndex>) && ...) | |
| GREM_ALWAYS_INLINE void | addBindings (Input input, Actions... actions) |
| Like addBindings(Input, Span<const OutputIndex>), but accepts a pack of "actions" of any enum type, which are interpreted as corresponding to the output numbers equal to their underlying values. | |
| template<enumeration Action> requires (!same_as<Action, Input> && !same_as<Action, OutputIndex>) | |
| GREM_ALWAYS_INLINE bool | isPressed (Action action) const noexcept |
| Like isPressed(OutputIndex) const, but accepts an "action" of any enum type, which is interpreted as corresponding to the output number equal to its underlying value. | |
| template<enumeration Action> requires (!same_as<Action, Input> && !same_as<Action, OutputIndex>) | |
| GREM_ALWAYS_INLINE bool | wasPreviouslyPressed (Action action) const noexcept |
| Like wasPreviouslyPressed(OutputIndex) const, but accepts an "action" of any enum type, which is interpreted as corresponding to the output number equal to its underlying value. | |
| template<enumeration Action> requires (!same_as<Action, Input> && !same_as<Action, OutputIndex>) | |
| GREM_ALWAYS_INLINE bool | justPressed (Action action) const noexcept |
| Like justPressed(OutputIndex) const, but accepts an "action" of any enum type, which is interpreted as corresponding to the output number equal to its underlying value. | |
| template<enumeration Action> requires (!same_as<Action, Input> && !same_as<Action, OutputIndex>) | |
| GREM_ALWAYS_INLINE bool | justReleased (Action action) const noexcept |
| Like justReleased(OutputIndex) const, but accepts an "action" of any enum type, which is interpreted as corresponding to the output number equal to its underlying value. | |
| template<enumeration Action> requires (!same_as<Action, Input> && !same_as<Action, OutputIndex>) | |
| GREM_ALWAYS_INLINE ControlState | getCurrentState (Action action) const noexcept |
| Like getCurrentState(OutputIndex) const, but accepts an "action" of any enum type, which is interpreted as corresponding to the output number equal to its underlying value. | |
| template<enumeration Action> requires (!same_as<Action, Input> && !same_as<Action, OutputIndex>) | |
| GREM_ALWAYS_INLINE ControlState | getPreviousState (Action action) const noexcept |
| Like getPreviousState(OutputIndex) const, but accepts an "action" of any enum type, which is interpreted as corresponding to the output number equal to its underlying value. | |
| template<enumeration Action> requires (!same_as<Action, Input> && !same_as<Action, OutputIndex>) | |
| GREM_ALWAYS_INLINE ControlDelta | getRelativeState (Action action) const noexcept |
| Like getRelativeState(OutputIndex) const, but accepts an "action" of any enum type, which is interpreted as corresponding to the output number equal to its underlying value. | |
| template<enumeration Action> requires (!same_as<Action, Input> && !same_as<Action, OutputIndex>) | |
| GREM_ALWAYS_INLINE ControlState | getCurrentState1D (Action actionNegative, Action actionPositive) const noexcept |
| Like getCurrentState1D(OutputIndex, OutputIndex) const, but accepts "actions" of any enum type, which are interpreted as corresponding to output numbers equal to their underlying values. | |
| template<enumeration Action> requires (!same_as<Action, Input> && !same_as<Action, OutputIndex>) | |
| GREM_ALWAYS_INLINE ControlState | getPreviousState1D (Action actionNegative, Action actionPositive) const noexcept |
| Like getPreviousState1D(OutputIndex, OutputIndex) const, but accepts "actions" of any enum type, which are interpreted as corresponding to output numbers equal to their underlying values. | |
| template<enumeration Action> requires (!same_as<Action, Input> && !same_as<Action, OutputIndex>) | |
| GREM_ALWAYS_INLINE ControlDelta | getRelativeState1D (Action actionNegative, Action actionPositive) const noexcept |
| Like getRelativeState1D(OutputIndex, OutputIndex) const, but accepts "actions" of any enum type, which are interpreted as corresponding to output numbers equal to their underlying values. | |
| template<enumeration Action> requires (!same_as<Action, Input> && !same_as<Action, OutputIndex>) | |
| GREM_ALWAYS_INLINE ControlState2D | getCurrentState2D (Action actionNegativeX, Action actionPositiveX, Action actionNegativeY, Action actionPositiveY) const noexcept |
| Like getCurrentState2D(OutputIndex, OutputIndex, OutputIndex, OutputIndex) const, but accepts "actions" of any enum type, which are interpreted as corresponding to the output numbers equal to their underlying values. | |
| template<enumeration Action> requires (!same_as<Action, Input> && !same_as<Action, OutputIndex>) | |
| GREM_ALWAYS_INLINE ControlState2D | getPreviousState2D (Action actionNegativeX, Action actionPositiveX, Action actionNegativeY, Action actionPositiveY) const noexcept |
| Like getPreviousState2D(OutputIndex, OutputIndex, OutputIndex, OutputIndex) const, but accepts "actions" of any enum type, which are interpreted as corresponding to the output numbers equal to their underlying values. | |
| template<enumeration Action> requires (!same_as<Action, Input> && !same_as<Action, OutputIndex>) | |
| GREM_ALWAYS_INLINE ControlDelta2D | getRelativeState2D (Action actionNegativeX, Action actionPositiveX, Action actionNegativeY, Action actionPositiveY) const noexcept |
| Like getRelativeState2D(OutputIndex, OutputIndex, OutputIndex, OutputIndex) const, but accepts "actions" of any enum type, which are interpreted as corresponding to the output numbers equal to their underlying values. | |
| template<enumeration Action> requires (!same_as<Action, Input> && !same_as<Action, OutputIndex>) | |
| GREM_ALWAYS_INLINE ControlState3D | getCurrentState3D (Action actionNegativeX, Action actionPositiveX, Action actionNegativeY, Action actionPositiveY, Action actionNegativeZ, Action actionPositiveZ) const noexcept |
| Like getCurrentState3D(OutputIndex, OutputIndex, OutputIndex, OutputIndex, OutputIndex, OutputIndex) const, but accepts "actions" of any enum type, which are interpreted as corresponding to the output numbers equal to their underlying values. | |
| template<enumeration Action> requires (!same_as<Action, Input> && !same_as<Action, OutputIndex>) | |
| GREM_ALWAYS_INLINE ControlState3D | getPreviousState3D (Action actionNegativeX, Action actionPositiveX, Action actionNegativeY, Action actionPositiveY, Action actionNegativeZ, Action actionPositiveZ) const noexcept |
| Like getPreviousState3D(OutputIndex, OutputIndex, OutputIndex, OutputIndex, OutputIndex, OutputIndex) const, but accepts "actions" of any enum type, which are interpreted as corresponding to the output numbers equal to their underlying values. | |
| template<enumeration Action> requires (!same_as<Action, Input> && !same_as<Action, OutputIndex>) | |
| GREM_ALWAYS_INLINE ControlDelta3D | getRelativeState3D (Action actionNegativeX, Action actionPositiveX, Action actionNegativeY, Action actionPositiveY, Action actionNegativeZ, Action actionPositiveZ) const noexcept |
| Like getRelativeState3D(OutputIndex, OutputIndex, OutputIndex, OutputIndex, OutputIndex, OutputIndex) const, but accepts "actions" of any enum type, which are interpreted as corresponding to the output numbers equal to their underlying values. | |
Static Public Attributes | |
| static constexpr OutputIndex | OUTPUT_COUNT = 64 |
| The maximum supported number of separate outputs that the input manager can keep track of. | |
System for mapping physical Input controls to abstract output numbers and processing input events that control their associated values.
By keeping an instance of this class and continuously feeding it the events associated with a specific user received from an EventPump, it can serve as the canonical representation of that user's input state across the program. After handling the events received in a frame, the input manager can be queried for the current state of any specific physical inputs, or the values of the abstract outputs to which they are bound, as well as the corresponding state on the previous frame. This combination also allows the inputs or outputs which were just pressed since the previous frame to be derived as well.
The supported input types include keyboard, mouse, touch and game controller devices, which can all be bound to and affect the same abstract output(s) simultaneously.
If there are multiple connected input devices of the same type, such as multiple game controllers, their outputs cannot be differentiated between within a single input manager. Therefore, if any filtering of events by their source/user is desired, such as in a splitscreen game, the filtering must be done manually before calling handleEvent(), for example by having one input manager per source/user and choosing which one to feed each input event to by searching for the user matching the event's ControllerEventBase::controllerID.
When saving and loading an input manager configuration, the expected JSON format is a JSON object consisting of optional properties corresponding to the fields of InputManagerPreferences, in addition to a property named "bindings", whose value is an object where each property has the lowercase identifier of the input to bind as its key and the case-insensitive name(s) of the actions to add to it as its value, either as an array or a single string.
All sensitivity values specified in the configuration represent multipliers of the initial sensitivity values provided in the input manager options, and may be specified as either single numbers or 2D vectors.
For example, given this action enum:
The following JSON would be a valid example of a possible configuration:
| using grem::events::InputManager::OutputIndex = uint8_t |
Abstract output number.
|
inline |
Construct an input manager with the default options.
|
explicit |
Construct an input manager.
| options | initial configuration of the input manager, see InputManagerOptions. |
| void grem::events::InputManager::loadConfiguration | ( | String | fileContents, |
| CStringView | filepath, | ||
| FunctionView< Optional< OutputIndex >(StringView actionName)> | getOutputIndex, | ||
| FunctionView< void(StringView key, json::Reader &reader)> | readExtraProperty = [](StringView, json::Reader &) -> void {} ) |
Apply the configuration specified in a JSON configuration file, adding to the previous bindings if any already existed for the same inputs.
| fileContents | contents of the JSON file containing the configuration to apply. |
| filepath | optional input filepath of the JSON file, for error reporting. |
| getOutputIndex | function that returns the abstract output number corresponding to the given action name, or an empty optional if the action name is invalid. |
| readExtraProperty | function for reading any custom extra properties in the top-level JSON object that are not part of the configuration format. |
| events::Error | on failure to parse the file contents, or if invalid input/action names were specified. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Apply the configuration specified in a JSON configuration file, adding to the previous bindings if any already existed for the same inputs.
| fileContents | contents of the JSON file containing the configuration to apply. |
| getOutputIndex | function that returns the abstract output number corresponding to the given action name, or an empty optional if the action name is invalid. |
| readExtraProperty | function for reading any custom extra properties in the top-level JSON object that are not part of the configuration format. |
| events::Error | on failure to parse the file contents, or if invalid input/action names were specified. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Apply the configuration specified in a JSON configuration file, assuming a set of abstract output numbers associated with a given enum type, adding to the previous bindings if any already existed for the same inputs.
| Action | enum type with a fixed underlying type, where each consecutive valid enumerand starting at value 0 corresponds to the output number of the same value. |
| fileContents | contents of the JSON file containing the configuration to apply. |
| filepath | optional input filepath of the JSON file, for error reporting. |
| readExtraProperty | function for reading any custom extra properties in the top-level JSON object that are not part of the configuration format. |
| events::Error | on failure to parse the file contents, or if invalid input/action names were specified. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Apply the configuration specified in a JSON configuration file, adding to the previous bindings if any already existed for the same inputs.
| filesystem | filesystem to load the file from. |
| filepath | input filepath of the JSON file to load. |
| getOutputIndex | function that returns the abstract output number corresponding to the given action name, or an empty optional if the action name is invalid. |
| readExtraProperty | function for reading any custom extra properties in the top-level JSON object that are not part of the configuration format. |
| File::Error | on failure to open or read from the file. |
| events::Error | on failure to parse the file contents, or if invalid input/action names were specified. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Apply the configuration specified in a JSON configuration file, assuming a set of abstract output numbers associated with a given enum type, adding to the previous bindings if any already existed for the same inputs.
| Action | enum type with a fixed underlying type, where each consecutive valid enumerand starting at value 0 corresponds to the output number of the same value. |
| filesystem | filesystem to load the file from. |
| filepath | input filepath of the JSON file to load. |
| readExtraProperty | function for reading any custom extra properties in the top-level JSON object that are not part of the configuration format. |
| File::Error | on failure to open or read from the file. |
| events::Error | on failure to parse the file contents, or if invalid input/action names were specified. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
nodiscard |
Save the current preferences and bindings to a JSON configuration string.
| getActionName | function that returns the action name corresponding to a specific output number, or an empty optional if the output number is invalid. |
| extraProperties | custom extra properties to write to the top-level JSON object that are not part of the configuration format. |
| events::Error | on failure to create a valid JSON configuration, or if the input manager contains bindings with outputs that are not in the specified action set. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inlinenodiscard |
Save the current preferences and bindings to a JSON configuration string for a set of abstract output numbers.
| Action | enum type with a fixed underlying type, where each consecutive valid enumerand starting at value 0 corresponds to the output number of the same value. |
| extraProperties | custom extra properties to write to the top-level JSON object that are not part of the configuration format. |
| events::Error | on failure to create a valid JSON configuration, or if the input manager contains bindings with outputs that are not in the specified action set. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Save the current preferences and bindings to a JSON configuration file.
| filesystem | filesystem to save the file to. |
| filepath | output filepath at which to save the JSON file. |
| getActionName | function that returns the action name corresponding to a specific output number, or an empty optional if the output number is invalid. |
| extraProperties | custom extra properties to write to the top-level JSON object that are not part of the configuration format. |
| File::Error | on failure to create or write to the file. |
| events::Error | on failure to write a valid JSON configuration to the file, or if the input manager contains bindings with outputs that are not in the specified action set. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Save the current preferences and bindings to a JSON configuration file for a set of abstract output numbers.
| Action | enum type with a fixed underlying type, where each consecutive valid enumerand starting at value 0 corresponds to the output number of the same value. |
| filesystem | filesystem to save the file to. |
| filepath | output filepath at which to save the JSON file. |
| extraProperties | custom extra properties to write to the top-level JSON object that are not part of the configuration format. |
| File::Error | on failure to create or write to the file. |
| events::Error | on failure to write a valid JSON configuration to the file, or if the input manager contains bindings with outputs that are not in the specified action set. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Advance the internal state to the next frame of inputs.
This effectively shifts any inputs/outputs which are currently considered to be pressed to the previous frame, and resets the relative input state.
| void grem::events::InputManager::handleEvent | ( | const Event & | event | ) |
Handle an event from an EventPump, which may cause updates to the internal input/output state of the current frame.
| event | event to handle. |
|
inline |
Poll events from the input manager and update the internal event buffer.
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inlinenodiscardnoexcept |
Get the latest output events in the internal event buffer that occured since the last call to pollOutputEvents().
| void grem::events::InputManager::bind | ( | Input | input, |
| ArrayList< OutputIndex > | outputIndices ) |
Bind a physical input to a set of abstract output numbers, overriding the previous binding if one already existed for the same input.
| input | physical input to set the binding for. |
| outputIndices | set of valid output numbers between 0 (inclusive) and OUTPUT_COUNT (exclusive) that the input should control. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
| void grem::events::InputManager::addBindings | ( | Input | input, |
| Span< const OutputIndex > | outputIndices ) |
Bind a physical input to a set of abstract output numbers, adding to the previous binding if one already existed for the same input.
| input | physical input to add the binding to. |
| outputIndices | additional set of valid output numbers between 0 (inclusive) and OUTPUT_COUNT (exclusive) that the input should control. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inline |
Bind a physical input to an abstract output number, adding to the previous binding if one already existed for the same input.
| input | physical input to add the binding to. |
| outputIndex | additional valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) that the input should control. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
noexcept |
Remove all bindings from a specific input.
| input | physical input to remove the binding from. |
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
noexcept |
Remove all bindings from all inputs.
|
inlinenoexcept |
Reset the states of all inputs and outputs for the current and previous frames, and clear all polled and pending events.
| void grem::events::InputManager::setCurrentState | ( | TimePoint | timestamp, |
| Input | input, | ||
| ControlState | newState ) |
Set the contribution of an input to its bound outputs to a new state.
| timestamp | time point at which the state change occured. |
| input | physical input to set the state of. |
| newState | state to set the input's contribution to. |
| void grem::events::InputManager::setCurrentState | ( | TimePoint | timestamp, |
| OutputIndex | outputIndex, | ||
| ControlState | newState ) |
Set the external contribution to an output to a new state.
| timestamp | time point at which the state change occured. |
| outputIndex | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to set the state of. |
| newState | state to set the output's external contribution to. |
|
inline |
Like setCurrentState(TimePoint, OutputIndex, ControlState), but accepts an "action" of any enum type, which is interpreted as corresponding to the output number equal to its underlying value.
| void grem::events::InputManager::addRelativeState | ( | TimePoint | timestamp, |
| Input | input, | ||
| ControlDelta | delta ) |
Apply a relative offset to the contribution of an input to its bound outputs for this frame only.
| timestamp | time point at which the state change occured. |
| input | physical input to apply the delta to. |
| delta | relative offset to apply to all bound outputs for this frame. |
| void grem::events::InputManager::addRelativeState | ( | TimePoint | timestamp, |
| OutputIndex | outputIndex, | ||
| ControlDelta | delta ) |
Apply a relative offset to the external contribution to an output for this frame only.
| timestamp | time point at which the state change occured. |
| outputIndex | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to apply the delta to. |
| delta | relative offset to apply to the output for this frame. |
|
inline |
Like addRelativeState(TimePoint, OutputIndex, ControlDelta), but accepts an "action" of any enum type, which is interpreted as corresponding to the output number equal to its underlying value.
| void grem::events::InputManager::releaseAll | ( | TimePoint | timestamp | ) |
Release all currently held inputs and outputs for the current frame, reset the positions of all inputs, and reset the contributions of all inputs and outputs to 0.
| timestamp | time point at which the release occured. |
|
inlinenoexcept |
Set the user preferences of the input manager.
| preferences | new user preferences, see InputManagerPreferences. |
|
inlinenoexcept |
Set whether output events should be emitted or not.
| emitOutputEvents | new state. |
|
inlinenodiscardnoexcept |
Get the current user preferences of the input manager.
|
inlinenodiscardnoexcept |
Get the initial user preferences of the input manager.
|
inlinenodiscardnoexcept |
Get the current configuration options of the input manager.
|
inlinenodiscardnoexcept |
Check if this input manager has any active bindings for any input.
|
inlinenodiscard |
Get all active bindings of this input manager.
| std::length_error | if an internal size limit was exceeded. |
| std::bad_array_new_length | if an internal size limit was exceeded. |
| std::bad_alloc | on allocation failure. |
|
inlinenodiscardnoexcept |
Get the set of outputs that a specific input is currently bound to.
| input | physical input for which to search for a binding. |
|
inlinenodiscardnoexcept |
Get the set of inputs that are bound to a specific output.
| outputIndex | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to get the bound inputs of. |
|
inlinenodiscardnoexcept |
Like getBoundInputs(OutputIndex) const noexcept, but accepts an "action" of any enum type, which is interpreted as corresponding to the output number equal to its underlying value.
|
inlinenodiscardnoexcept |
Get the latest known mouse position processed by the input manager.
|
inlinenodiscardnoexcept |
Get the second last known mouse position processed by the input manager.
|
inlinenodiscardnoexcept |
Get the relative motion between the last two known mouse positions processed by the input manager.
|
inlinenodiscardnoexcept |
Check if the mouse just moved on the current frame.
|
inlinenodiscardnoexcept |
Get the relative distance scrolled horizontally by the mouse wheel in the last frame processed by the input manager.
|
inlinenodiscardnoexcept |
Check if the mouse wheel was just scrolled horizontally on the current frame.
|
inlinenodiscardnoexcept |
Check if the mouse wheel was just scrolled vertically on the current frame.
|
inlinenodiscardnoexcept |
Get the latest known touch finger position processed by the input manager.
|
inlinenodiscardnoexcept |
Get the second last known touch finger position processed by the input manager.
|
inlinenodiscardnoexcept |
Get the relative motion between the last two known touch finger positions processed by the input manager.
|
inlinenodiscardnoexcept |
Check if the touch finger just moved on the current frame.
|
inlinenodiscardnoexcept |
Get the latest known touch finger pressure processed by the input manager.
|
inlinenodiscardnoexcept |
Get the second last known touch finger pressure processed by the input manager.
|
inlinenodiscardnoexcept |
Get the relative pressure between the last two known touch finger pressures processed by the input manager.
|
inlinenodiscardnoexcept |
Check if the touch finger just changed pressure on the current frame.
|
inlinenodiscardnoexcept |
Get the relative scale performed by finger pinch in the last frame processed by the input manager.
|
inlinenodiscardnoexcept |
Check if finger pinch was just performed on the current frame.
|
inlinenodiscardnoexcept |
Get the latest known position of the left analog stick of the connected controller, if there is one.
|
inlinenodiscardnoexcept |
Get the second last known position of the left analog stick of the connected controller, if there is one.
|
inlinenodiscardnoexcept |
Get the relative motion between the last two known positions of the left analog stick of the connected controller, if there is one.
|
inlinenodiscardnoexcept |
Check if the controller left analog stick just moved on the current frame.
|
inlinenodiscardnoexcept |
Get the latest known position of the right analog stick of the connected controller, if there is one.
|
inlinenodiscardnoexcept |
Get the second last known position of the right analog stick of the connected controller, if there is one.
|
inlinenodiscardnoexcept |
Get the relative motion between the last two known positions of the right analog stick of the connected controller, if there is one.
|
inlinenodiscardnoexcept |
Check if the controller right analog stick just moved on the current frame.
|
inlinenodiscardnoexcept |
Get the latest known position of the left trigger of the connected controller, if there is one.
|
inlinenodiscardnoexcept |
Get the second last known position of the left trigger of the connected controller, if there is one.
|
inlinenodiscardnoexcept |
Get the relative motion between the last two known positions of the left trigger of the connected controller, if there is one.
|
inlinenodiscardnoexcept |
Check if the controller left trigger just moved on the current frame.
|
inlinenodiscardnoexcept |
Get the latest known position of the right trigger of the connected controller, if there is one.
|
inlinenodiscardnoexcept |
Get the second last known position of the right trigger of the connected controller, if there is one.
|
inlinenodiscardnoexcept |
Get the relative motion between the last two known positions of the right trigger of the connected controller, if there is one.
|
inlinenodiscardnoexcept |
Check if the controller right trigger just moved on the current frame.
|
inlinenodiscardnoexcept |
Check if a specific output is currently pressed, i.e. if its contributions from all of its bound inputs and external sources sum up to a value greater than 0.
| outputIndex | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to check the associated state of. |
|
inlinenodiscardnoexcept |
Check if a specific output was pressed on the previous frame, i.e. if its contributions from all of its bound inputs and external sources summed up to a value greater than 0.
| outputIndex | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to check the associated state of. |
|
inlinenodiscardnoexcept |
Check if a specific output had a press triggered on the current frame.
| outputIndex | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to check the associated state of. |
|
inlinenodiscardnoexcept |
Check if a specific output had a release triggered on the current frame.
| outputIndex | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to check the associated state of. |
|
inlinenodiscardnoexcept |
Get the current total absolute state of a specific output, which consists of the accumulated contributions from all of its bound inputs.
| outputIndex | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to get the associated state of. |
|
inlinenodiscardnoexcept |
Get the previous total absolute value of a specific output, which consists of the accumulated contributions from all of its bound inputs.
| outputIndex | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to get the associated state of. |
|
inlinenodiscardnoexcept |
Get the total relative delta of a specific output, which consists of the accumulated contributions from all of its bound inputs.
| outputIndex | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to get the associated state of. |
|
inlinenodiscardnoexcept |
Get the current combined absolute state of two specific outputs along one axis, which consists of the accumulated contributions from all of their bound inputs.
| outputNegative | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the negative contribution to the resulting value. |
| outputPositive | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the positive contribution to the resulting value. |
|
inlinenodiscardnoexcept |
Get the previous combined absolute state of two specific outputs along one axis, which consists of the accumulated contributions from all of their bound inputs.
| outputNegative | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the negative contribution to the resulting value. |
| outputPositive | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the positive contribution to the resulting value. |
|
inlinenodiscardnoexcept |
Get the combined relative delta of two specific outputs along one axis, which consists of the accumulated contributions from all of their bound inputs.
| outputNegative | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the negative contribution to the resulting value. |
| outputPositive | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the positive contribution to the resulting value. |
|
inlinenodiscardnoexcept |
Get the current combined absolute state of four specific outputs along two orthogonal axes, which consists of the accumulated contributions from all of their bound inputs.
| outputNegativeX | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the negative contribution to the x component of the resulting vector. |
| outputPositiveX | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the positive contribution to the x component of the resulting vector. |
| outputNegativeY | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the negative contribution to the y component of the resulting vector. |
| outputPositiveY | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the positive contribution to the y component of the resulting vector. |
|
inlinenodiscardnoexcept |
Get the previous combined absolute state of four specific outputs along two orthogonal axes, which consists of the accumulated contributions from all of their bound inputs.
| outputNegativeX | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the negative contribution to the x component of the resulting vector. |
| outputPositiveX | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the positive contribution to the x component of the resulting vector. |
| outputNegativeY | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the negative contribution to the y component of the resulting vector. |
| outputPositiveY | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the positive contribution to the y component of the resulting vector. |
|
inlinenodiscardnoexcept |
Get the combined relative delta of four specific outputs along two orthogonal axes, which consists of the accumulated contributions from all of their bound inputs.
| outputNegativeX | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the negative contribution to the x component of the resulting vector. |
| outputPositiveX | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the positive contribution to the x component of the resulting vector. |
| outputNegativeY | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the negative contribution to the y component of the resulting vector. |
| outputPositiveY | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the positive contribution to the y component of the resulting vector. |
|
inlinenodiscardnoexcept |
Get the current combined absolute state of six specific outputs along three orthogonal axes, which consists of the accumulated contributions from all of their bound inputs.
| outputNegativeX | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the negative contribution to the x component of the resulting vector. |
| outputPositiveX | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the positive contribution to the x component of the resulting vector. |
| outputNegativeY | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the negative contribution to the y component of the resulting vector. |
| outputPositiveY | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the positive contribution to the y component of the resulting vector. |
| outputNegativeZ | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the negative contribution to the z component of the resulting vector. |
| outputPositiveZ | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the positive contribution to the z component of the resulting vector. |
|
inlinenodiscardnoexcept |
Get the previous combined absolute state of six specific outputs along three orthogonal axes, which consists of the accumulated contributions from all of their bound inputs.
| outputNegativeX | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the negative contribution to the x component of the resulting vector. |
| outputPositiveX | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the positive contribution to the x component of the resulting vector. |
| outputNegativeY | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the negative contribution to the y component of the resulting vector. |
| outputPositiveY | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the positive contribution to the y component of the resulting vector. |
| outputNegativeZ | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the negative contribution to the z component of the resulting vector. |
| outputPositiveZ | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the positive contribution to the z component of the resulting vector. |
|
inlinenodiscardnoexcept |
Get the combined relative delta of six specific outputs along three orthogonal axes, which consists of the accumulated contributions from all of their bound inputs.
| outputNegativeX | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the negative contribution to the x component of the resulting vector. |
| outputPositiveX | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the positive contribution to the x component of the resulting vector. |
| outputNegativeY | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the negative contribution to the y component of the resulting vector. |
| outputPositiveY | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the positive contribution to the y component of the resulting vector. |
| outputNegativeZ | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the negative contribution to the z component of the resulting vector. |
| outputPositiveZ | valid output number between 0 (inclusive) and OUTPUT_COUNT (exclusive) to use for the positive contribution to the z component of the resulting vector. |
|
inlinenodiscardnoexcept |
Check if a specific input is currently in a pressed state.
| input | input to check the associated state of. |
|
inlinenodiscardnoexcept |
Check if a specific input was in a pressed state on the previous frame.
| input | input to check the associated state of. |
|
inlinenodiscardnoexcept |
Check if a specific input had a press triggered on the current frame.
| input | input to check the associated state of. |
|
inlinenodiscardnoexcept |
Check if a specific input had a release triggered on the current frame.
| input | input to check the associated state of. |
|
inlinenodiscardnoexcept |
Get the current absolute value of a specific input.
| input | input to get the associated value of. |
|
inlinenodiscardnoexcept |
Get the previous absolute value of a specific input.
| input | input to get the associated value of. |
|
inlinenodiscardnoexcept |
Get the relative delta of a specific input.
| input | input to get the associated value of. |
|
inlinenodiscardnoexcept |
Get the current combined absolute state of two specific inputs along one axis.
| inputNegative | input to use for the negative contribution to the resulting value. |
| inputPositive | input to use for the positive contribution to the resulting value. |
|
inlinenodiscardnoexcept |
Get the previous combined absolute state of two specific inputs along one axis.
| inputNegative | input to use for the negative contribution to the resulting value. |
| inputPositive | input to use for the positive contribution to the resulting value. |
|
inlinenodiscardnoexcept |
Get the combined relative delta of two specific inputs along one axis.
| inputNegative | input to use for the negative contribution to the resulting value. |
| inputPositive | input to use for the positive contribution to the resulting value. |
|
inlinenodiscardnoexcept |
Get the current combined absolute state of four specific inputs along two orthogonal axes.
| inputNegativeX | input to use for the negative contribution to the x component of the resulting vector. |
| inputPositiveX | input to use for the positive contribution to the x component of the resulting vector. |
| inputNegativeY | input to use for the negative contribution to the y component of the resulting vector. |
| inputPositiveY | input to use for the positive contribution to the y component of the resulting vector. |
|
inlinenodiscardnoexcept |
Get the previous combined absolute state of four specific inputs along two orthogonal axes.
| inputNegativeX | input to use for the negative contribution to the x component of the resulting vector. |
| inputPositiveX | input to use for the positive contribution to the x component of the resulting vector. |
| inputNegativeY | input to use for the negative contribution to the y component of the resulting vector. |
| inputPositiveY | input to use for the positive contribution to the y component of the resulting vector. |
|
inlinenodiscardnoexcept |
Get the combined relative delta of four specific inputs along two orthogonal axes.
| inputNegativeX | input to use for the negative contribution to the x component of the resulting vector. |
| inputPositiveX | input to use for the positive contribution to the x component of the resulting vector. |
| inputNegativeY | input to use for the negative contribution to the y component of the resulting vector. |
| inputPositiveY | input to use for the positive contribution to the y component of the resulting vector. |
|
inlinenodiscardnoexcept |
Get the current combined scaled absolute value of six specific inputs along three orthogonal axes.
| inputNegativeX | input to use for the negative contribution to the x component of the resulting vector. |
| inputPositiveX | input to use for the positive contribution to the x component of the resulting vector. |
| inputNegativeY | input to use for the negative contribution to the y component of the resulting vector. |
| inputPositiveY | input to use for the positive contribution to the y component of the resulting vector. |
| inputNegativeZ | input to use for the negative contribution to the z component of the resulting vector. |
| inputPositiveZ | input to use for the positive contribution to the z component of the resulting vector. |
|
inlinenodiscardnoexcept |
Get the previous combined scaled absolute value of six specific inputs along three orthogonal axes.
| inputNegativeX | input to use for the negative contribution to the x component of the resulting vector. |
| inputPositiveX | input to use for the positive contribution to the x component of the resulting vector. |
| inputNegativeY | input to use for the negative contribution to the y component of the resulting vector. |
| inputPositiveY | input to use for the positive contribution to the y component of the resulting vector. |
| inputNegativeZ | input to use for the negative contribution to the z component of the resulting vector. |
| inputPositiveZ | input to use for the positive contribution to the z component of the resulting vector. |
|
inlinenodiscardnoexcept |
Get the current combined scaled relative value of six specific outputs along three orthogonal axes.
| inputNegativeX | input to use for the negative contribution to the x component of the resulting vector. |
| inputPositiveX | input to use for the positive contribution to the x component of the resulting vector. |
| inputNegativeY | input to use for the negative contribution to the y component of the resulting vector. |
| inputPositiveY | input to use for the positive contribution to the y component of the resulting vector. |
| inputNegativeZ | input to use for the negative contribution to the z component of the resulting vector. |
| inputPositiveZ | input to use for the positive contribution to the z component of the resulting vector. |
|
inline |
Like bind(Input, ArrayList<OutputIndex>), but accepts a pack of "actions" of any enum type, which are interpreted as corresponding to the output numbers equal to their underlying values.
|
inline |
Like addBinding(Input, OutputIndex), but accepts a pack of "actions" of any enum type, which are interpreted as corresponding to the output numbers equal to their underlying values.
|
inline |
Like addBindings(Input, Span<const OutputIndex>), but accepts a pack of "actions" of any enum type, which are interpreted as corresponding to the output numbers equal to their underlying values.
|
inlinenodiscardnoexcept |
Like isPressed(OutputIndex) const, but accepts an "action" of any enum type, which is interpreted as corresponding to the output number equal to its underlying value.
|
inlinenodiscardnoexcept |
Like wasPreviouslyPressed(OutputIndex) const, but accepts an "action" of any enum type, which is interpreted as corresponding to the output number equal to its underlying value.
|
inlinenodiscardnoexcept |
Like justPressed(OutputIndex) const, but accepts an "action" of any enum type, which is interpreted as corresponding to the output number equal to its underlying value.
|
inlinenodiscardnoexcept |
Like justReleased(OutputIndex) const, but accepts an "action" of any enum type, which is interpreted as corresponding to the output number equal to its underlying value.
|
inlinenodiscardnoexcept |
Like getCurrentState(OutputIndex) const, but accepts an "action" of any enum type, which is interpreted as corresponding to the output number equal to its underlying value.
|
inlinenodiscardnoexcept |
Like getPreviousState(OutputIndex) const, but accepts an "action" of any enum type, which is interpreted as corresponding to the output number equal to its underlying value.
|
inlinenodiscardnoexcept |
Like getRelativeState(OutputIndex) const, but accepts an "action" of any enum type, which is interpreted as corresponding to the output number equal to its underlying value.
|
inlinenodiscardnoexcept |
Like getCurrentState1D(OutputIndex, OutputIndex) const, but accepts "actions" of any enum type, which are interpreted as corresponding to output numbers equal to their underlying values.
|
inlinenodiscardnoexcept |
Like getPreviousState1D(OutputIndex, OutputIndex) const, but accepts "actions" of any enum type, which are interpreted as corresponding to output numbers equal to their underlying values.
|
inlinenodiscardnoexcept |
Like getRelativeState1D(OutputIndex, OutputIndex) const, but accepts "actions" of any enum type, which are interpreted as corresponding to output numbers equal to their underlying values.
|
inlinenodiscardnoexcept |
Like getCurrentState2D(OutputIndex, OutputIndex, OutputIndex, OutputIndex) const, but accepts "actions" of any enum type, which are interpreted as corresponding to the output numbers equal to their underlying values.
|
inlinenodiscardnoexcept |
Like getPreviousState2D(OutputIndex, OutputIndex, OutputIndex, OutputIndex) const, but accepts "actions" of any enum type, which are interpreted as corresponding to the output numbers equal to their underlying values.
|
inlinenodiscardnoexcept |
Like getRelativeState2D(OutputIndex, OutputIndex, OutputIndex, OutputIndex) const, but accepts "actions" of any enum type, which are interpreted as corresponding to the output numbers equal to their underlying values.
|
inlinenodiscardnoexcept |
Like getCurrentState3D(OutputIndex, OutputIndex, OutputIndex, OutputIndex, OutputIndex, OutputIndex) const, but accepts "actions" of any enum type, which are interpreted as corresponding to the output numbers equal to their underlying values.
|
inlinenodiscardnoexcept |
Like getPreviousState3D(OutputIndex, OutputIndex, OutputIndex, OutputIndex, OutputIndex, OutputIndex) const, but accepts "actions" of any enum type, which are interpreted as corresponding to the output numbers equal to their underlying values.
|
inlinenodiscardnoexcept |
Like getRelativeState3D(OutputIndex, OutputIndex, OutputIndex, OutputIndex, OutputIndex, OutputIndex) const, but accepts "actions" of any enum type, which are interpreted as corresponding to the output numbers equal to their underlying values.
|
staticconstexpr |
The maximum supported number of separate outputs that the input manager can keep track of.