aboutsummaryrefslogtreecommitdiffstats
path: root/include/window.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/window.hpp')
-rw-r--r--include/window.hpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/include/window.hpp b/include/window.hpp
index dae4f00..85f0a18 100644
--- a/include/window.hpp
+++ b/include/window.hpp
@@ -10,24 +10,39 @@ class vkrenderer;
#if defined(LINUX)
#include <xcb/xcb.h>
+
+#include <xkbcommon/xkbcommon.h>
#elif defined(WINDOWS)
#include <Windows.h>
#endif
+enum KEYS {
+ SPACE,
+ Z,
+ Q,
+ S,
+ D,
+};
+
enum EVENT_TYPES: int32_t {
QUIT,
RESIZE,
+ KEY_PRESS,
+ KEY_RELEASE,
};
struct event {
uint32_t width;
uint32_t height;
+ // KEYS key;
+ uint32_t keycode;
EVENT_TYPES type;
};
class window {
public:
window(uint32_t width, uint32_t height);
+ ~window();
void poll_events();
@@ -42,6 +57,11 @@ class window {
xcb_connection_t* connection;
xcb_window_t win;
xcb_atom_t win_delete_atom;
+
+ xkb_context* xkb_ctx;
+ int32_t keyboard_device_id;
+ xkb_keymap* keyboard_keymap;
+ xkb_state* keyboard_state;
#endif
std::vector<event> events;