From 2580087ef23fe21ae4dbed45fb8cfa14fbfd7b9f Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 21 Jan 2025 19:45:33 +0100 Subject: Add mapping notify event --- include/mgl/window/event.h | 12 ++++++++++++ include/mgl/window/key.h | 3 +++ 2 files changed, 15 insertions(+) (limited to 'include') diff --git a/include/mgl/window/event.h b/include/mgl/window/event.h index 4813154..ab7ce35 100644 --- a/include/mgl/window/event.h +++ b/include/mgl/window/event.h @@ -59,6 +59,16 @@ typedef struct { int id; } mgl_monitor_disconnected_event; +typedef enum { + MGL_MAPPING_NOTIFY_MODIFIER, + MGL_MAPPING_NOTIFY_KEYBOARD, + MGL_MAPPING_NOTIFY_POINTER +} mgl_mapping_notify_type; + +typedef struct { + int notify_type; /* mgl_mapping_notify_type */ +} mgl_mapping_notify_event; + typedef enum { MGL_EVENT_UNKNOWN, MGL_EVENT_CLOSED, /* Window closed */ @@ -75,6 +85,7 @@ typedef enum { MGL_EVENT_MONITOR_CONNECTED, MGL_EVENT_MONITOR_DISCONNECTED, MGL_EVENT_MONITOR_PROPERTY_CHANGED, + MGL_EVENT_MAPPING_NOTIFY } mgl_event_type; struct mgl_event { @@ -89,6 +100,7 @@ struct mgl_event { mgl_monitor_connected_event monitor_connected; mgl_monitor_disconnected_event monitor_disconnected; mgl_monitor_property_changed_event monitor_property_changed; + mgl_mapping_notify_event mapping_notify; }; }; diff --git a/include/mgl/window/key.h b/include/mgl/window/key.h index c58fbcd..6863256 100644 --- a/include/mgl/window/key.h +++ b/include/mgl/window/key.h @@ -1,6 +1,8 @@ #ifndef _MGL_KEY_H_ #define _MGL_KEY_H_ +#include + typedef enum { MGL_KEY_UNKNOWN, MGL_KEY_A, @@ -111,5 +113,6 @@ typedef enum { /* Return NULL if unknown key */ const char* mgl_key_to_string(mgl_key key); +bool mgl_key_is_modifier(mgl_key key); #endif /* _MGL_KEY_H_ */ -- cgit v1.2.3