aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Script.h
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-17 14:50:08 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-17 14:50:08 +0100
commitc3c565f7c8d1e7e9899b8c2fbb1c313a45e4b10b (patch)
tree33b937a5c0cd3413078ac6fd9ccc82ee60763acd /src/crepe/api/Script.h
parent4080a2eec207b35b36f7d0ceae7c2afcfcdfd977 (diff)
parent9232a98b72eee7af4f7f2153c1b2ccedbfa4cc65 (diff)
Merge branch 'master' of https://github.com/lonkaars/crepe into wouter/text-component
Diffstat (limited to 'src/crepe/api/Script.h')
-rw-r--r--src/crepe/api/Script.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/crepe/api/Script.h b/src/crepe/api/Script.h
index 668e5d1..65306cd 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: