diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
index 7e70e7258d..8c12b29a99 100644
--- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp
+++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp
@@ -903,7 +903,7 @@ QList<int> QXcbKeyboard::possibleKeys(const QKeyEvent *event) const
             Qt::KeyboardModifiers mods = modifiers & ~neededMods;
             qtKey = keysymToQtKey(sym, mods, lookupString(kb_state, event->nativeScanCode()));
 
-            if (qtKey == baseQtKey)
+            if (qtKey == baseQtKey || qtKey == 0)
                 continue;
 
             result += (qtKey + mods);