aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Script.h
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-17 14:25:47 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-17 14:25:47 +0100
commitbec22107c6754f5f3440d79503ddbc828d7e0cba (patch)
tree074567b1b2071117b369ff9ec208655655e334b4 /src/crepe/api/Script.h
parent4d4d791a329c0ca4f0496fd8cb1656a1dab66e47 (diff)
parentc96ef5f62a1369d66e8eba9bf8ed192e3cf8e716 (diff)
merge master
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 1429108..0ec3476 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/LoopTimerManager.h"
#include "../manager/Mediator.h"
@@ -147,7 +148,22 @@ protected:
//! Retrieve LoopTimerManager reference
LoopTimerManager & get_loop_timer() 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:
/**