From 142a370cba076a7cf593c7a48b5414e992311a20 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Thu, 21 Jan 2021 20:38:09 +0100 Subject: Setup xkb --- include/window.hpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include/window.hpp') 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 + +#include #elif defined(WINDOWS) #include #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 events; -- cgit v1.3