aboutsummaryrefslogtreecommitdiff
path: root/src/window/window.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2025-01-21 19:45:33 +0100
committerdec05eba <dec05eba@protonmail.com>2025-01-21 19:45:33 +0100
commit2580087ef23fe21ae4dbed45fb8cfa14fbfd7b9f (patch)
treed88508b9b7303a418ad56d27c7ba4a837a9b6913 /src/window/window.c
parent66e7ceaa96de5c2acdea89b33773219ec0bb2c27 (diff)
Add mapping notify event
Diffstat (limited to 'src/window/window.c')
-rw-r--r--src/window/window.c14
1 files changed, 13 insertions, 1 deletions
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: {