From aafc9a80b7bd1791d99dfcfd749cad6425658745 Mon Sep 17 00:00:00 2001 From: "arthur.jamet" Date: Fri, 14 May 2021 19:19:41 +0200 Subject: [PATCH] documentation for controllers --- lib/Ray/include/Controllers/Gamepad.hpp | 3 ++- lib/Ray/include/Controllers/Keyboard.hpp | 17 +++++++++++++++++ lib/Ray/include/Controllers/Mouse.hpp | 14 ++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) diff --git a/lib/Ray/include/Controllers/Gamepad.hpp b/lib/Ray/include/Controllers/Gamepad.hpp index eb93126e..01c32a78 100644 --- a/lib/Ray/include/Controllers/Gamepad.hpp +++ b/lib/Ray/include/Controllers/Gamepad.hpp @@ -49,7 +49,8 @@ namespace Ray { //! @param Button The keycode of the button bool isUp(Button); - //! @brief Returns a vector containing keycode of currently pressed keys + //! @brief Fetch currently pressed buttons + //! @return Returns a vector containing keycode of currently pressed buttons std::vector getPressedButtons(void); private: diff --git a/lib/Ray/include/Controllers/Keyboard.hpp b/lib/Ray/include/Controllers/Keyboard.hpp index e3934cbc..c5200c3a 100644 --- a/lib/Ray/include/Controllers/Keyboard.hpp +++ b/lib/Ray/include/Controllers/Keyboard.hpp @@ -17,11 +17,28 @@ namespace Ray { public: typedef ::KeyboardKey Key; + //! @return true if Key is pressed on the keyboard + //! @param Key The keycode of the key static bool isPressed(Key); + + //! @return true if Key is down on the keyboard + //! @param Key The keycode of the key static bool isDown(Key); + + //! @return true if Key is released on the keyboard + //! @param Key The keycode of the key static bool isReleased(Key); + + //! @return true if Key is up on the keyboard + //! @param Key The keycode of the key static bool isUp(Key); + + //! @brief Fetch currently pressed keys + //! @return a vector containing keycode of currently pressed keys static std::vector getPressedKeys(void); + + //! @brief Fetch currently pressed keys + //! @return a vector containing char of currently pressed keys static std::vector getPressedChars(void); }; } diff --git a/lib/Ray/include/Controllers/Mouse.hpp b/lib/Ray/include/Controllers/Mouse.hpp index 1857bc4f..9e0145af 100644 --- a/lib/Ray/include/Controllers/Mouse.hpp +++ b/lib/Ray/include/Controllers/Mouse.hpp @@ -17,10 +17,24 @@ namespace Ray { public: typedef ::MouseButton Button; + //! @return true if Key is pressed on the keyboard + //! @param Key The keycode of the key static bool isPressed(Button); + + //! @return true if Key is down on the keyboard + //! @param Key The keycode of the key static bool isDown(Button); + + //! @return true if Key is released on the keyboard + //! @param Key The keycode of the key static bool isReleased(Button); + + //! @return true if Key is up on the keyboard + //! @param Key The keycode of the key static bool isUp(Button); + + //! @brief Fetch currently pressed buttons + //! @return a vector containing keycode of currently pressed buttons static std::vector getPressedButtons(void); }; }