[bug] Linux shortcuts not working

On my system keyboard shortcuts are not working: when entering a shortcut like “CTRL-N”,
XLookupString will not give me the text “N”, but the ascii control character “^N” (as in “0x0e” / shift out).

the following workaround fixes the issue for me. would be great if it could be integrated or fixed differently:

--------- juce_gui_basics/native/juce_linux_X11_Windowing.cpp ---------
index ab9b9496b..fd2f124ea 100644
@@ -1660,15 +1660,24 @@ public:
 
         {
             ScopedXLock xlock (display);
             updateKeyStates ((int) keyEvent.keycode, true);
 
             String oldLocale (::setlocale (LC_ALL, 0));
             ::setlocale (LC_ALL, "");
-            XLookupString (&keyEvent, utf8, sizeof (utf8), &sym, 0);
+
+            // XLookupString would return control sequences, which is not what we want
+            if (keyEvent.state & ControlMask) {
+                XKeyEvent evtCopy = keyEvent;
+                evtCopy.state &= ~ControlMask;
+                XLookupString (&evtCopy, utf8, sizeof (utf8), &sym, 0);
+            } else
+                XLookupString (&keyEvent, utf8, sizeof (utf8), &sym, 0);
 
             if (oldLocale.isNotEmpty())
                 ::setlocale (LC_ALL, oldLocale.toRawUTF8());
 
             unicodeChar = *CharPointer_UTF8 (utf8);
             keyCode = (int) unicodeChar;

What do you mean by this - are you using KeyListeners and Component::keyPressed()? What does your code for handling keyboard shortcuts look like?

This case is handled in the line below where we call XkbKeycodeToKeysym() to translate the keycode to the key with the right group and shift level. Do you have an unusual keyboard layout or bindings perhaps?

This case is handled in the line below where we call XkbKeycodeToKeysym() to translate the keycode to the key with the right group and shift level. Do you have an unusual keyboard layout or bindings perhaps?

i’m using colemak. the keycode is resolved via XkbKeycodeToKeysym, but unicodeChar is passed as 0x0e, not as 0x6e