diff --git a/sources/System/Gamepad/GamepadSystem.cpp b/sources/System/Gamepad/GamepadSystem.cpp index f59f87dc..e28b389f 100644 --- a/sources/System/Gamepad/GamepadSystem.cpp +++ b/sources/System/Gamepad/GamepadSystem.cpp @@ -17,7 +17,7 @@ namespace BBM : System(wal) {} - void GamepadSystem::onFixedUpdate(WAL::ViewEntity &entity) + void GamepadSystem::onUpdate(WAL::ViewEntity &entity, std::chrono::nanoseconds) { const auto &gamepadComponent = entity.get(); auto &controllable = entity.get(); @@ -34,6 +34,8 @@ namespace BBM for (auto key : keyPressedMap) key.second = controllable.fastClick ? gamepad.isDown(key.first) : gamepad.isPressed(key.first); + if (gamepad.isPressed(GAMEPAD_BUTTON_MIDDLE_LEFT) || gamepad.isPressed(GAMEPAD_BUTTON_MIDDLE_RIGHT)) + controllable.pause = true; controllable.move.x = gamepad.getAxisValue(gamepadComponent.LeftStickX) * -1; controllable.move.y = gamepad.getAxisValue(gamepadComponent.LeftStickY) * -1; controllable.move.x -= static_cast(gamepad.isDown(gamepadComponent.keyRight)); diff --git a/sources/System/Gamepad/GamepadSystem.hpp b/sources/System/Gamepad/GamepadSystem.hpp index 61efdd5e..187d1bbf 100644 --- a/sources/System/Gamepad/GamepadSystem.hpp +++ b/sources/System/Gamepad/GamepadSystem.hpp @@ -16,7 +16,7 @@ namespace BBM { public: //! @inherit - void onFixedUpdate(WAL::ViewEntity &entity) override; + void onUpdate(WAL::ViewEntity &entity, std::chrono::nanoseconds) override; //! @brief A default constructor explicit GamepadSystem(WAL::Wal &wal);