27 {XK_Shift_L, Qt::Key_Shift},
28 {XK_Shift_R, Qt::Key_Shift},
30 {XK_Control_L, Qt::Key_Control},
31 {XK_Control_R, Qt::Key_Control},
33 {XK_Meta_L, Qt::Key_Alt},
34 {XK_Meta_R, Qt::Key_Alt},
35 {XK_Mode_switch, Qt::Key_AltGr},
36 {XK_ISO_Level3_Shift, Qt::Key_AltGr},
38 {XK_Alt_L, Qt::Key_Alt},
39 {XK_Alt_R, Qt::Key_Alt},
41 {XK_Super_L, Qt::Key_Meta},
42 {XK_Super_R, Qt::Key_Meta},
44 {XK_Hyper_L, Qt::Key_Hyper_L},
45 {XK_Hyper_R, Qt::Key_Hyper_R},
47 {XK_space, Qt::Key_Space},
130#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
131 XDisplayKeycodes(QX11Info::display(), &minKeyCode, &maxKeyCode);
132 XQueryKeymap(QX11Info::display(), keysState);
134 XDisplayKeycodes(qGuiApp->nativeInterface<QNativeInterface::QX11Application>()->display(),
137 XQueryKeymap(qGuiApp->nativeInterface<QNativeInterface::QX11Application>()->display(), keysState);
141 auto checkKeyCodePressedX11 = [&keysState] (KeyCode key) ->
bool {
143 char mask = 1 << (key % 8);
144 return keysState[byte] & mask;
147 for (
int keyCode = minKeyCode; keyCode <= maxKeyCode; keyCode++) {
148 if (checkKeyCodePressedX11(keyCode)) {
149#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
150 KeySym sym = XkbKeycodeToKeysym(QX11Info::display(),
153 KeySym sym = XkbKeycodeToKeysym(qGuiApp->nativeInterface<QNativeInterface::QX11Application>()->display(),
161 modifiers << map.
qtKey;