From e89ec81ae3c4b35c655fef68c6302b12521dda6f Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 21 Jan 2025 22:37:43 +0100 Subject: Add key_to_x11_keysym --- include/mglpp/window/Event.hpp | 4 ++-- include/mglpp/window/Keyboard.hpp | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/mglpp/window/Event.hpp b/include/mglpp/window/Event.hpp index 97e2d91..35b83a4 100644 --- a/include/mglpp/window/Event.hpp +++ b/include/mglpp/window/Event.hpp @@ -63,14 +63,14 @@ namespace mgl { int id; }; - enum class MappingChangedType { + enum class MappingChangedType : int { MODIFIER, KEYBOARD, POINTER }; struct MappingChangedEvent { - int type; // MappingChangedType + MappingChangedType type; }; enum Type : int { diff --git a/include/mglpp/window/Keyboard.hpp b/include/mglpp/window/Keyboard.hpp index a7eb36e..7200f5f 100644 --- a/include/mglpp/window/Keyboard.hpp +++ b/include/mglpp/window/Keyboard.hpp @@ -1,6 +1,8 @@ #ifndef MGLPP_KEYBOARD_HPP #define MGLPP_KEYBOARD_HPP +#include + namespace mgl { class Keyboard { public: @@ -116,6 +118,7 @@ namespace mgl { /* Returns nullptr if unknown key */ static const char* key_to_string(Key key); static bool key_is_modifier(Key key); + static uint64_t key_to_x11_keysym(Key key); }; } -- cgit v1.2.3