From ef30edf5e0319b16e5384d031802e1669014b7f8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 26 Apr 2017 22:30:36 +0200 Subject: [PATCH] Fix keyboard event key codes when using Wayland Correct the confusion between compile- and run-time checks for X11. See #17848. (cherry picked from commit 7542632302b0723c3ed7018dc843764ea62582b4) --- docs/changes.txt | 1 + src/gtk/window.cpp | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index b859d07472..0565bca4c1 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -629,6 +629,7 @@ wxGTK: - Make items selected from keyboard visible in wxListCtrl (Jonathan Dagresta). - Cosmetic fix for empty wxCheckBoxes display (Chuddah). - Fix crashes in wxFileSystemWatcher implementation (David Hart). +- Fix key events codes when using Wayland (David Hart). wxMSW: diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index e979fd123d..41ea787f44 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -810,9 +810,11 @@ wxTranslateGTKKeyEventToWx(wxKeyEvent& event, // got one key_code = keysymNormalized ? keysymNormalized : keysym; } -#else - key_code = keysym; -#endif + else +#endif // GDK_WINDOWING_X11 + { + key_code = keysym; + } // as explained above, we want to have lower register key codes // normally but for the letter keys we want to have the upper ones