From 89ea3af65e4e8dd0a4974d221493ce44de672987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20D=C3=BCrrenberger?= Date: Thu, 23 Jun 2022 19:59:24 +0200 Subject: [PATCH] Add mapping notification support for X11 --- src/SFML/Window/Unix/KeyboardImpl.cpp | 2 +- src/SFML/Window/Unix/WindowImplX11.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/SFML/Window/Unix/KeyboardImpl.cpp b/src/SFML/Window/Unix/KeyboardImpl.cpp index d30fd9d0..621fb73a 100644 --- a/src/SFML/Window/Unix/KeyboardImpl.cpp +++ b/src/SFML/Window/Unix/KeyboardImpl.cpp @@ -782,7 +782,7 @@ String KeyboardImpl::getDescription(Keyboard::Scancode code) case Keyboard::Scan::LaunchMail: return "Launch Mail"; case Keyboard::Scan::LaunchMediaSelect: return "Launch Media Select"; - default: return "Unknown Scancode"; + default: return "Unknown Scancode"; } } diff --git a/src/SFML/Window/Unix/WindowImplX11.cpp b/src/SFML/Window/Unix/WindowImplX11.cpp index d5038e9c..86a3fb76 100644 --- a/src/SFML/Window/Unix/WindowImplX11.cpp +++ b/src/SFML/Window/Unix/WindowImplX11.cpp @@ -2005,6 +2005,15 @@ bool WindowImplX11::processEvent(XEvent& windowEvent) break; } + // Keyboard mapping changed + case MappingNotify: + { + if (windowEvent.xmapping.request == MappingKeyboard) + XRefreshKeyboardMapping(&windowEvent.xmapping); + + break; + } + // Window unmapped case UnmapNotify: {