aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2025-01-21 22:37:43 +0100
committerdec05eba <dec05eba@protonmail.com>2025-01-21 22:37:43 +0100
commite89ec81ae3c4b35c655fef68c6302b12521dda6f (patch)
treee4390c218b8c7055f0ebe0e5a6b01f0b05ab9b24
parent7e35869648a0037a488c0ffdababc53379d0c67c (diff)
Add key_to_x11_keysymHEADmaster
m---------depends/mgl0
-rw-r--r--include/mglpp/window/Event.hpp4
-rw-r--r--include/mglpp/window/Keyboard.hpp3
-rw-r--r--src/window/Keyboard.cpp5
4 files changed, 10 insertions, 2 deletions
diff --git a/depends/mgl b/depends/mgl
-Subproject c613fed749cff8fee16ea3906a5f39d1fe8dc20
+Subproject 227b96247baeec7a3f44cf82c4560f2aca282c1
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 <stdint.h>
+
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);
};
}
diff --git a/src/window/Keyboard.cpp b/src/window/Keyboard.cpp
index f60e5cd..34d28be 100644
--- a/src/window/Keyboard.cpp
+++ b/src/window/Keyboard.cpp
@@ -14,4 +14,9 @@ namespace mgl {
bool Keyboard::key_is_modifier(Key key) {
return mgl_key_is_modifier((mgl_key)key);
}
+
+ // static
+ uint64_t Keyboard::key_to_x11_keysym(Key key) {
+ return mgl_key_to_x11_keysym((mgl_key)key);
+ }
} \ No newline at end of file