aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/mglpp/window/Event.hpp12
-rw-r--r--include/mglpp/window/Keyboard.hpp7
2 files changed, 19 insertions, 0 deletions
diff --git a/include/mglpp/window/Event.hpp b/include/mglpp/window/Event.hpp
index bcd1e91..35b83a4 100644
--- a/include/mglpp/window/Event.hpp
+++ b/include/mglpp/window/Event.hpp
@@ -63,6 +63,16 @@ namespace mgl {
int id;
};
+ enum class MappingChangedType : int {
+ MODIFIER,
+ KEYBOARD,
+ POINTER
+ };
+
+ struct MappingChangedEvent {
+ MappingChangedType type;
+ };
+
enum Type : int {
Unknown,
Closed, /* Window closed */
@@ -79,6 +89,7 @@ namespace mgl {
MonitorConnected,
MonitorDisconnected,
MonitorPropertyChanged,
+ MappingChanged
};
Type type;
@@ -93,6 +104,7 @@ namespace mgl {
MonitorConnectedEvent monitor_connected;
MonitorDisconnectedEvent monitor_disconnected;
MonitorPropertyChangedEvent monitor_property_changed;
+ MappingChangedEvent mapping_changed;
};
};
}
diff --git a/include/mglpp/window/Keyboard.hpp b/include/mglpp/window/Keyboard.hpp
index 17c4d7c..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:
@@ -112,6 +114,11 @@ namespace mgl {
/* This should always be the last key */
__NumKeys__
};
+
+ /* 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);
};
}