diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-17 14:35:36 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-17 14:35:36 +0100 |
commit | bd26d3812aceab9cfcd55c19b17271cd6ef4ccb0 (patch) | |
tree | 4f2118294118a751a4b83167a7fea4fcd0bea899 /src/crepe/api/Script.h | |
parent | 7039acfa49e64b6865c7897de29a1b812b8df7d0 (diff) | |
parent | c96ef5f62a1369d66e8eba9bf8ed192e3cf8e716 (diff) |
Merge branch 'master' into niels/UI
Diffstat (limited to 'src/crepe/api/Script.h')
-rw-r--r-- | src/crepe/api/Script.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/crepe/api/Script.h b/src/crepe/api/Script.h index 8bca38a..5d49223 100644 --- a/src/crepe/api/Script.h +++ b/src/crepe/api/Script.h @@ -2,6 +2,7 @@ #include <vector> +#include "../api/KeyCodes.h" #include "../manager/EventManager.h" #include "../manager/Mediator.h" #include "../system/CollisionSystem.h" @@ -134,7 +135,22 @@ protected: //! Retrieve SaveManager reference SaveManager & get_save_manager() const; - + /** + * \brief Utility function to retrieve the keyboard state + * \see SDLContext::get_keyboard_state + * + * \return current keyboard state map with Keycode as key and bool as value(true = pressed, false = not pressed) + * + */ + const keyboard_state_t & get_keyboard_state() const; + /** + * \brief Utility function to retrieve a single key state. + * \see SDLContext::get_keyboard_state + * + * \return Keycode state (true if pressed, false if not pressed). + * + */ + bool get_key_state(Keycode key) const noexcept; //! \} private: |