diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-17 15:20:29 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-12-17 15:20:29 +0100 |
commit | ba99bcbac33d05bc2067c9211c0fe453b2930a8d (patch) | |
tree | a032c8268fece08866d7f398bf781fd356560579 /src/crepe/api/Script.h | |
parent | 45a1ab16f29e85de7c2df8832f51967c10c43e92 (diff) | |
parent | 9232a98b72eee7af4f7f2153c1b2ccedbfa4cc65 (diff) |
merge master
Diffstat (limited to 'src/crepe/api/Script.h')
-rw-r--r-- | src/crepe/api/Script.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/crepe/api/Script.h b/src/crepe/api/Script.h index 6536fa4..2750df0 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 "../manager/ReplayManager.h" @@ -157,7 +158,23 @@ protected: replay(OptionalRef<Mediator> & mediator) : mediator(mediator) {} friend class Script; } replay{mediator}; - //! \} + + /** + * \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: /** |