aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Script.h
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-17 09:25:11 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-17 09:25:11 +0100
commit093493d1ecc082672d80707c31bd95a5175ab2ce (patch)
tree7a692e5bafff5bfda971ce3e9c91ba48bbd7b5dc /src/crepe/api/Script.h
parentcc2ec343367ebaa3b6a6142532f7a067c3c981a1 (diff)
parent3c99c73f3c1c31ba97f7e8c74f434c880f8a9036 (diff)
Merge branch 'wouter/inputSystem' into wouter/button-improvement
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..b5d3dd2 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;
//! \}
private: