3#include "inputAction/inputMapping.hpp"
4#include "systems/RenderConcept.hpp"
9namespace rtk::systems {
23template <ecs::concepts::IsRenderWindow WindowType>
35 : _window(window.get()), _inputState(inputState), _mapping(mapping) {};
42 void onStart(rtk::ecs::Registry &)
override {
43 LOG_DEBUG(
"Load Input System");
49 void onStop(rtk::ecs::Registry &)
override {}
54 void update([[maybe_unused]] rtk::ecs::Registry ®,
float)
override {
58 if (!_window.pollEvents(_event))
69 const auto &b = bindings[startIndex + slot];
74 bool isPressed =
false;
84 isPressed = (b.axisData.validationPression < 0)
85 ? (pression <= b.axisData.validationPression)
86 : (pression >= b.axisData.validationPression);
Input query interface filled by the window backend.
Definition RenderConcept.hpp:186
bool isKeyReleased(Key key) const
Tells whether a key was released this frame.
Definition RenderConcept.hpp:225
bool isKeyPressed(Key key) const
Tells whether a key is held.
Definition RenderConcept.hpp:216
bool isGamepadButtonPressed(int joystickId, GamepadButton button) const
Tells whether a gamepad button is held.
Definition RenderConcept.hpp:271
bool isMouseButtonPressed(MouseButton button) const
Tells whether a mouse button is held.
Definition RenderConcept.hpp:234
float getGamepadAxis(int joystickId, GamepadAxis axis) const
Returns the position of a gamepad axis.
Definition RenderConcept.hpp:297