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 --- src/window/window.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/window/window.c') diff --git a/src/window/window.c b/src/window/window.c index 485e400..9bf6917 100644 --- a/src/window/window.c +++ b/src/window/window.c @@ -1566,7 +1566,19 @@ static void mgl_window_on_receive_event(mgl_window *self, XEvent *xev, mgl_event } case MappingNotify: { XRefreshKeyboardMapping(&xev->xmapping); - event->type = MGL_EVENT_UNKNOWN; + event->type = MGL_EVENT_MAPPING_NOTIFY; + event->mapping_notify.notify_type = MappingModifier; + switch(xev->xmapping.request) { + case MappingModifier: + event->mapping_notify.notify_type = MGL_MAPPING_NOTIFY_MODIFIER; + break; + case MappingKeyboard: + event->mapping_notify.notify_type = MGL_MAPPING_NOTIFY_KEYBOARD; + break; + case MappingPointer: + event->mapping_notify.notify_type = MGL_MAPPING_NOTIFY_POINTER; + break; + } break; } default: { -- cgit v1.2.3