aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api
diff options
context:
space:
mode:
authorWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-12 17:46:21 +0100
committerWBoerenkamps <wrj.boerenkamps@student.avans.nl>2024-12-12 17:46:21 +0100
commit6e2aa75019a28c298454f50b7bfb0dca100e0936 (patch)
tree7975a5c57956b472b9ad1a4e46d846239714bc79 /src/crepe/api
parent44cab6ad59d257d949112dcd4a9e0bdc9302e92b (diff)
save
Diffstat (limited to 'src/crepe/api')
-rw-r--r--src/crepe/api/Event.h5
-rw-r--r--src/crepe/api/KeyCodes.h5
2 files changed, 10 insertions, 0 deletions
diff --git a/src/crepe/api/Event.h b/src/crepe/api/Event.h
index d3e99af..d222e51 100644
--- a/src/crepe/api/Event.h
+++ b/src/crepe/api/Event.h
@@ -2,9 +2,12 @@
// TODO discussing the location of these events
#include <string>
+#include <unordered_map>
+
#include "KeyCodes.h"
#include "types.h"
+
namespace crepe {
/**
@@ -22,6 +25,7 @@ public:
//! The key that was pressed.
Keycode key = Keycode::NONE;
+ keyboard_state_t keyboard_state;
};
/**
@@ -31,6 +35,7 @@ class KeyReleaseEvent : public Event {
public:
//! The key that was released.
Keycode key = Keycode::NONE;
+ keyboard_state_t keyboard_state;
};
/**
diff --git a/src/crepe/api/KeyCodes.h b/src/crepe/api/KeyCodes.h
index f704fbb..4a3bf57 100644
--- a/src/crepe/api/KeyCodes.h
+++ b/src/crepe/api/KeyCodes.h
@@ -1,4 +1,7 @@
#pragma once
+
+#include <unordered_map>
+
namespace crepe {
//! Enumeration for mouse button inputs, including standard and extended buttons.
enum class MouseButton {
@@ -153,4 +156,6 @@ typedef enum {
//! Not actually a key instead its the amount of keycodes there are for array indexing
NUM_KEYCODES = 512,
} Keycode;
+
+typedef std::unordered_map<Keycode, bool> keyboard_state_t;
} // namespace crepe