53 # include <X11/XKBlib.h> 60 #include <X11/keysymdef.h> 68 #define IsKeypadKey(keysym) \ 69 (((KeySym)(keysym) >= XK_KP_Space) && ((KeySym)(keysym) <= XK_KP_Equal)) 71 #undef IsPrivateKeypadKey 72 #define IsPrivateKeypadKey(keysym) \ 73 (((KeySym)(keysym) >= 0x11000000) && ((KeySym)(keysym) <= 0x1100FFFF)) 106 #define SETMASK(sym, mask) \ 108 if (qt_alt_mask == 0 \ 109 && qt_meta_mask != mask \ 110 && qt_super_mask != mask \ 111 && qt_hyper_mask != mask \ 112 && (sym == XK_Alt_L || sym == XK_Alt_R)) { \ 113 qt_alt_mask = mask; \ 115 if (qt_meta_mask == 0 \ 116 && qt_alt_mask != mask \ 117 && qt_super_mask != mask \ 118 && qt_hyper_mask != mask \ 119 && (sym == XK_Meta_L || sym == XK_Meta_R)) { \ 120 qt_meta_mask = mask; \ 122 if (qt_super_mask == 0 \ 123 && qt_alt_mask != mask \ 124 && qt_meta_mask != mask \ 125 && qt_hyper_mask != mask \ 126 && (sym == XK_Super_L || sym == XK_Super_R)) { \ 127 qt_super_mask = mask; \ 129 if (qt_hyper_mask == 0 \ 130 && qt_alt_mask != mask \ 131 && qt_meta_mask != mask \ 132 && qt_super_mask != mask \ 133 && (sym == XK_Hyper_L || sym == XK_Hyper_R)) { \ 134 qt_hyper_mask = mask; \ 136 if (qt_mode_switch_mask == 0 \ 137 && qt_alt_mask != mask \ 138 && qt_meta_mask != mask \ 139 && qt_super_mask != mask \ 140 && qt_hyper_mask != mask \ 141 && sym == XK_Mode_switch) { \ 142 qt_mode_switch_mask = mask; \ 144 if (qt_num_lock_mask == 0 \ 145 && sym == XK_Num_Lock) { \ 146 qt_num_lock_mask = mask; \ 182 register unsigned int modifiers,
183 unsigned int *modifiers_return,
184 KeySym *keysym_return)
187 register KeySym *syms;
188 KeySym sym, lsym, usym;
192 *modifiers_return = ((ShiftMask|LockMask)
193 | dpy->mode_switch | dpy->num_lock);
194 if (((
int)keycode < dpy->min_keycode) || ((
int)keycode > dpy->max_keycode))
196 *keysym_return = NoSymbol;
199 per = dpy->keysyms_per_keycode;
200 syms = &dpy->keysyms[(keycode - dpy->min_keycode) * per];
201 while ((per > 2) && (syms[per - 1] == NoSymbol))
203 if ((per > 2) && (modifiers & dpy->mode_switch)) {
207 if ((modifiers & dpy->num_lock) &&
208 (per > 1 && (IsKeypadKey(syms[1]) || IsPrivateKeypadKey(syms[1])))) {
209 if ((modifiers & ShiftMask) ||
210 ((modifiers & LockMask) && (dpy->lock_meaning == XK_Shift_Lock)))
211 *keysym_return = syms[0];
213 *keysym_return = syms[1];
214 }
else if (!(modifiers & ShiftMask) &&
215 (!(modifiers & LockMask) || (dpy->lock_meaning == NoSymbol))) {
216 if ((per == 1) || (syms[1] == NoSymbol))
217 XConvertCase(syms[0], keysym_return, &usym);
219 *keysym_return = syms[0];
220 }
else if (!(modifiers & LockMask) ||
221 (dpy->lock_meaning != XK_Caps_Lock)) {
222 if ((per == 1) || ((usym = syms[1]) == NoSymbol))
223 XConvertCase(syms[0], &lsym, &usym);
224 *keysym_return = usym;
226 if ((per == 1) || ((sym = syms[1]) == NoSymbol))
228 XConvertCase(sym, &lsym, &usym);
229 if (!(modifiers & ShiftMask) && (sym != syms[0]) &&
230 ((sym != usym) || (lsym == usym)))
231 XConvertCase(syms[0], &lsym, &usym);
232 *keysym_return = usym;
234 if (*keysym_return == XK_VoidSymbol)
235 *keysym_return = NoSymbol;
245 memset(&coreDesc, 0,
sizeof(coreDesc));
250 XkbStateRec xkbState;
251 if (XkbGetState(
X11->display, XkbUseCoreKbd, &xkbState) ==
Success)
252 xkb_currentGroup = xkbState.group;
259 if (coreDesc.keysyms)
260 XFree(coreDesc.keysyms);
267 return possibleKeysXKB(event);
269 return possibleKeysCore(event);
274 int &code, Qt::KeyboardModifiers &modifiers,
280 const int xkeycode =
event->nativeScanCode();
281 const uint xmodifiers =
event->nativeModifiers();
286 uint consumedModifiers;
288 &consumedModifiers, &baseKeySym))
294 Qt::KeyboardModifiers baseModifiers = 0;
299 if (baseCode == -1) {
305 if (baseCode && baseCode < 0xfffe)
307 result += (baseCode | baseModifiers);
312 for (
int i = 0; i <
MaxBits; ++i) {
313 if (consumedModifiers & (1 << i))
314 pos1Bits[num1Bits++] = i;
317 const int numPerms = (1 << num1Bits);
320 for (
int i = 1; i < numPerms; ++i) {
322 for (
int j = 0; j < num1Bits; ++j) {
324 val |= (1 << pos1Bits[j]);
327 if ((xmodifiers & val) != val)
332 if (!XkbLookupKeySym(
X11->display, xkeycode, val, &mods, &sym))
336 Qt::KeyboardModifiers modifiers = 0;
341 text =
translateKeySym(sym, xmodifiers & ~val, code, modifiers, chars, count);
348 if (code && code < 0xfffe)
357 if (code == baseCode)
360 result += (code | modifiers);
364 qDebug() <<
"possibleKeysXKB()" <<
hex << result;
375 const int xkeycode =
event->nativeScanCode();
376 const uint xmodifiers =
event->nativeModifiers();
381 uint consumedModifiers;
383 &consumedModifiers, &baseKeySym))
389 Qt::KeyboardModifiers baseModifiers = 0;
394 if (baseCode == -1) {
400 if (baseCode && baseCode < 0xfffe)
402 result += (baseCode | baseModifiers);
407 for (
int i = 0; i <
MaxBits; ++i) {
408 if (consumedModifiers & (1 << i))
409 pos1Bits[num1Bits++] = i;
412 const int numPerms = (1 << num1Bits);
415 for (
int i = 1; i < numPerms; ++i) {
417 for (
int j = 0; j < num1Bits; ++j) {
419 val |= (1 << pos1Bits[j]);
422 if ((xmodifiers & val) != val)
431 Qt::KeyboardModifiers modifiers = 0;
436 text =
translateKeySym(sym, xmodifiers & ~val, code, modifiers, chars, count);
443 if (code && code < 0xfffe)
452 if (code == baseCode)
455 result += (code | modifiers);
459 qDebug() <<
"possibleKeysCore()" <<
hex << result;
485 ulong bytesAfter = 0;
488 false, XA_STRING, &type, &format, &nitems, &bytesAfter, &data) ==
Success 489 && type == XA_STRING && format == 8 && nitems > 2) {
497 char *names[5] = { 0, 0, 0, 0, 0 };
498 char *p =
reinterpret_cast<char *
>(
data), *
end = p + nitems;
508 layoutName = layoutNames.
at(xkb_currentGroup);
511 variantName = variantNames.
at(xkb_currentGroup);
522 qDebug() <<
"keyboard input locale =" 532 if (coreDesc.keysyms)
533 XFree(coreDesc.keysyms);
535 coreDesc.min_keycode = 8;
536 coreDesc.max_keycode = 255;
537 XDisplayKeycodes(
X11->display, &coreDesc.min_keycode, &coreDesc.max_keycode);
539 coreDesc.keysyms_per_keycode = 0;
540 coreDesc.keysyms = XGetKeyboardMapping(
X11->display,
541 coreDesc.min_keycode,
542 coreDesc.max_keycode - coreDesc.min_keycode + 1,
543 &coreDesc.keysyms_per_keycode);
546 qDebug() <<
"min_keycode =" << coreDesc.min_keycode;
547 qDebug() <<
"max_keycode =" << coreDesc.max_keycode;
548 qDebug() <<
"keysyms_per_keycode =" << coreDesc.keysyms_per_keycode;
549 qDebug() <<
"keysyms =" << coreDesc.keysyms;
567 XkbDescPtr xkbDesc = XkbGetMap(
X11->display, XkbAllClientInfoMask, XkbUseCoreKbd);
568 for (
int i = xkbDesc->min_key_code; i < xkbDesc->max_key_code; ++i) {
569 const uint mask = xkbDesc->map->modmap ? xkbDesc->map->modmap[i] : 0;
575 for (
int j = 0; j < XkbKeyGroupsWidth(xkbDesc, i); ++j) {
576 KeySym keySym = XkbKeySym(xkbDesc, i, j);
577 if (keySym == NoSymbol)
582 XkbFreeKeyboard(xkbDesc, XkbAllComponentsMask,
true);
586 coreDesc.lock_meaning = NoSymbol;
588 XModifierKeymap *
map = XGetModifierMapping(
X11->display);
591 int i, maskIndex = 0, mapIndex = 0;
592 for (maskIndex = 0; maskIndex < 8; maskIndex++) {
593 for (i = 0; i < map->max_keypermod; i++) {
594 if (map->modifiermap[mapIndex]) {
598 sym = XKeycodeToKeysym(
X11->display, map->modifiermap[mapIndex], x++);
599 }
while (sym == NoSymbol && x < coreDesc.keysyms_per_keycode);
600 const uchar mask = 1 << maskIndex;
608 for (i = 0; i < map->max_keypermod; ++i) {
609 for (
int x = 0; x < coreDesc.keysyms_per_keycode; ++x) {
610 KeySym sym = XKeycodeToKeysym(
X11->display, map->modifiermap[LockMapIndex], x);
611 if (sym == XK_Caps_Lock || sym == XK_ISO_Lock) {
612 coreDesc.lock_meaning = XK_Caps_Lock;
614 }
else if (sym == XK_Shift_Lock) {
615 coreDesc.lock_meaning = XK_Shift_Lock;
620 XFreeModifiermap(map);
628 qDebug() <<
"lock_meaning =" << coreDesc.lock_meaning;
629 qDebug() <<
"num_lock =" << coreDesc.num_lock;
630 qDebug() <<
"mode_switch =" << coreDesc.mode_switch;
668 #ifndef XK_ISO_Left_Tab 669 #define XK_ISO_Left_Tab 0xFE20 673 #define XK_dead_hook 0xFE61 677 #define XK_dead_horn 0xFE62 681 #define XK_Codeinput 0xFF37 684 #ifndef XK_Kanji_Bangou 685 #define XK_Kanji_Bangou 0xFF37 690 #define XK_KP_Home 0xFF95 693 #define XK_KP_Left 0xFF96 696 #define XK_KP_Up 0xFF97 699 #define XK_KP_Right 0xFF98 702 #define XK_KP_Down 0xFF99 705 #define XK_KP_Prior 0xFF9A 708 #define XK_KP_Next 0xFF9B 711 #define XK_KP_End 0xFF9C 714 #define XK_KP_Insert 0xFF9E 717 #define XK_KP_Delete 0xFF9F 722 #define XF86XK_MonBrightnessUp 0x1008FF02 723 #define XF86XK_MonBrightnessDown 0x1008FF03 724 #define XF86XK_KbdLightOnOff 0x1008FF04 725 #define XF86XK_KbdBrightnessUp 0x1008FF05 726 #define XF86XK_KbdBrightnessDown 0x1008FF06 727 #define XF86XK_Standby 0x1008FF10 728 #define XF86XK_AudioLowerVolume 0x1008FF11 729 #define XF86XK_AudioMute 0x1008FF12 730 #define XF86XK_AudioRaiseVolume 0x1008FF13 731 #define XF86XK_AudioPlay 0x1008FF14 732 #define XF86XK_AudioStop 0x1008FF15 733 #define XF86XK_AudioPrev 0x1008FF16 734 #define XF86XK_AudioNext 0x1008FF17 735 #define XF86XK_HomePage 0x1008FF18 736 #define XF86XK_Mail 0x1008FF19 737 #define XF86XK_Start 0x1008FF1A 738 #define XF86XK_Search 0x1008FF1B 739 #define XF86XK_AudioRecord 0x1008FF1C 740 #define XF86XK_Calculator 0x1008FF1D 741 #define XF86XK_Memo 0x1008FF1E 742 #define XF86XK_ToDoList 0x1008FF1F 743 #define XF86XK_Calendar 0x1008FF20 744 #define XF86XK_PowerDown 0x1008FF21 745 #define XF86XK_ContrastAdjust 0x1008FF22 746 #define XF86XK_Back 0x1008FF26 747 #define XF86XK_Forward 0x1008FF27 748 #define XF86XK_Stop 0x1008FF28 749 #define XF86XK_Refresh 0x1008FF29 750 #define XF86XK_PowerOff 0x1008FF2A 751 #define XF86XK_WakeUp 0x1008FF2B 752 #define XF86XK_Eject 0x1008FF2C 753 #define XF86XK_ScreenSaver 0x1008FF2D 754 #define XF86XK_WWW 0x1008FF2E 755 #define XF86XK_Sleep 0x1008FF2F 756 #define XF86XK_Favorites 0x1008FF30 757 #define XF86XK_AudioPause 0x1008FF31 758 #define XF86XK_AudioMedia 0x1008FF32 759 #define XF86XK_MyComputer 0x1008FF33 760 #define XF86XK_LightBulb 0x1008FF35 761 #define XF86XK_Shop 0x1008FF36 762 #define XF86XK_History 0x1008FF37 763 #define XF86XK_OpenURL 0x1008FF38 764 #define XF86XK_AddFavorite 0x1008FF39 765 #define XF86XK_HotLinks 0x1008FF3A 766 #define XF86XK_BrightnessAdjust 0x1008FF3B 767 #define XF86XK_Finance 0x1008FF3C 768 #define XF86XK_Community 0x1008FF3D 769 #define XF86XK_AudioRewind 0x1008FF3E 770 #define XF86XK_BackForward 0x1008FF3F 771 #define XF86XK_Launch0 0x1008FF40 772 #define XF86XK_Launch1 0x1008FF41 773 #define XF86XK_Launch2 0x1008FF42 774 #define XF86XK_Launch3 0x1008FF43 775 #define XF86XK_Launch4 0x1008FF44 776 #define XF86XK_Launch5 0x1008FF45 777 #define XF86XK_Launch6 0x1008FF46 778 #define XF86XK_Launch7 0x1008FF47 779 #define XF86XK_Launch8 0x1008FF48 780 #define XF86XK_Launch9 0x1008FF49 781 #define XF86XK_LaunchA 0x1008FF4A 782 #define XF86XK_LaunchB 0x1008FF4B 783 #define XF86XK_LaunchC 0x1008FF4C 784 #define XF86XK_LaunchD 0x1008FF4D 785 #define XF86XK_LaunchE 0x1008FF4E 786 #define XF86XK_LaunchF 0x1008FF4F 787 #define XF86XK_ApplicationLeft 0x1008FF50 788 #define XF86XK_ApplicationRight 0x1008FF51 789 #define XF86XK_Book 0x1008FF52 790 #define XF86XK_CD 0x1008FF53 791 #define XF86XK_Calculater 0x1008FF54 792 #define XF86XK_Clear 0x1008FF55 793 #define XF86XK_ClearGrab 0x1008FE21 794 #define XF86XK_Close 0x1008FF56 795 #define XF86XK_Copy 0x1008FF57 796 #define XF86XK_Cut 0x1008FF58 797 #define XF86XK_Display 0x1008FF59 798 #define XF86XK_DOS 0x1008FF5A 799 #define XF86XK_Documents 0x1008FF5B 800 #define XF86XK_Excel 0x1008FF5C 801 #define XF86XK_Explorer 0x1008FF5D 802 #define XF86XK_Game 0x1008FF5E 803 #define XF86XK_Go 0x1008FF5F 804 #define XF86XK_iTouch 0x1008FF60 805 #define XF86XK_LogOff 0x1008FF61 806 #define XF86XK_Market 0x1008FF62 807 #define XF86XK_Meeting 0x1008FF63 808 #define XF86XK_MenuKB 0x1008FF65 809 #define XF86XK_MenuPB 0x1008FF66 810 #define XF86XK_MySites 0x1008FF67 811 #define XF86XK_News 0x1008FF69 812 #define XF86XK_OfficeHome 0x1008FF6A 813 #define XF86XK_Option 0x1008FF6C 814 #define XF86XK_Paste 0x1008FF6D 815 #define XF86XK_Phone 0x1008FF6E 816 #define XF86XK_Reply 0x1008FF72 817 #define XF86XK_Reload 0x1008FF73 818 #define XF86XK_RotateWindows 0x1008FF74 819 #define XF86XK_RotationPB 0x1008FF75 820 #define XF86XK_RotationKB 0x1008FF76 821 #define XF86XK_Save 0x1008FF77 822 #define XF86XK_Send 0x1008FF7B 823 #define XF86XK_Spell 0x1008FF7C 824 #define XF86XK_SplitScreen 0x1008FF7D 825 #define XF86XK_Support 0x1008FF7E 826 #define XF86XK_TaskPane 0x1008FF7F 827 #define XF86XK_Terminal 0x1008FF80 828 #define XF86XK_Tools 0x1008FF81 829 #define XF86XK_Travel 0x1008FF82 830 #define XF86XK_Video 0x1008FF87 831 #define XF86XK_Word 0x1008FF89 832 #define XF86XK_Xfer 0x1008FF8A 833 #define XF86XK_ZoomIn 0x1008FF8B 834 #define XF86XK_ZoomOut 0x1008FF8C 835 #define XF86XK_Away 0x1008FF8D 836 #define XF86XK_Messenger 0x1008FF8E 837 #define XF86XK_WebCam 0x1008FF8F 838 #define XF86XK_MailForward 0x1008FF90 839 #define XF86XK_Pictures 0x1008FF91 840 #define XF86XK_Music 0x1008FF92 841 #define XF86XK_Battery 0x1008FF93 842 #define XF86XK_Bluetooth 0x1008FF94 843 #define XF86XK_WLAN 0x1008FF95 844 #define XF86XK_UWB 0x1008FF96 845 #define XF86XK_AudioForward 0x1008FF97 846 #define XF86XK_AudioRepeat 0x1008FF98 847 #define XF86XK_AudioRandomPlay 0x1008FF99 848 #define XF86XK_Subtitle 0x1008FF9A 849 #define XF86XK_AudioCycleTrack 0x1008FF9B 850 #define XF86XK_Time 0x1008FF9F 851 #define XF86XK_Select 0x1008FFA0 852 #define XF86XK_View 0x1008FFA1 853 #define XF86XK_TopMenu 0x1008FFA2 854 #define XF86XK_Suspend 0x1008FFA7 855 #define XF86XK_Hibernate 0x1008FFA8 861 #define QTOPIAXK_Select 0x11000601 862 #define QTOPIAXK_Yes 0x11000602 863 #define QTOPIAXK_No 0x11000603 864 #define QTOPIAXK_Cancel 0x11000604 865 #define QTOPIAXK_Printer 0x11000605 866 #define QTOPIAXK_Execute 0x11000606 867 #define QTOPIAXK_Sleep 0x11000607 868 #define QTOPIAXK_Play 0x11000608 869 #define QTOPIAXK_Zoom 0x11000609 870 #define QTOPIAXK_Context1 0x1100060A 871 #define QTOPIAXK_Context2 0x1100060B 872 #define QTOPIAXK_Context3 0x1100060C 873 #define QTOPIAXK_Context4 0x1100060D 874 #define QTOPIAXK_Call 0x1100060E 875 #define QTOPIAXK_Hangup 0x1100060F 876 #define QTOPIAXK_Flip 0x11000610 1224 #if !defined(QT_NO_XIM) 1226 0x0000, 0x3002, 0x300C, 0x300D, 0x3001, 0x30FB, 0x30F2, 0x30A1,
1227 0x30A3, 0x30A5, 0x30A7, 0x30A9, 0x30E3, 0x30E5, 0x30E7, 0x30C3,
1228 0x30FC, 0x30A2, 0x30A4, 0x30A6, 0x30A8, 0x30AA, 0x30AB, 0x30AD,
1229 0x30AF, 0x30B1, 0x30B3, 0x30B5, 0x30B7, 0x30B9, 0x30BB, 0x30BD,
1230 0x30BF, 0x30C1, 0x30C4, 0x30C6, 0x30C8, 0x30CA, 0x30CB, 0x30CC,
1231 0x30CD, 0x30CE, 0x30CF, 0x30D2, 0x30D5, 0x30D8, 0x30DB, 0x30DE,
1232 0x30DF, 0x30E0, 0x30E1, 0x30E2, 0x30E4, 0x30E6, 0x30E8, 0x30E9,
1233 0x30EA, 0x30EB, 0x30EC, 0x30ED, 0x30EF, 0x30F3, 0x309B, 0x309C
1237 0x0000, 0x0452, 0x0453, 0x0451, 0x0454, 0x0455, 0x0456, 0x0457,
1238 0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x0000, 0x045e, 0x045f,
1239 0x2116, 0x0402, 0x0403, 0x0401, 0x0404, 0x0405, 0x0406, 0x0407,
1240 0x0408, 0x0409, 0x040a, 0x040b, 0x040c, 0x0000, 0x040e, 0x040f,
1241 0x044e, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433,
1242 0x0445, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e,
1243 0x043f, 0x044f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432,
1244 0x044c, 0x044b, 0x0437, 0x0448, 0x044d, 0x0449, 0x0447, 0x044a,
1245 0x042e, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413,
1246 0x0425, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e,
1247 0x041f, 0x042f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412,
1248 0x042c, 0x042b, 0x0417, 0x0428, 0x042d, 0x0429, 0x0427, 0x042a
1252 0x0000, 0x0386, 0x0388, 0x0389, 0x038a, 0x03aa, 0x0000, 0x038c,
1253 0x038e, 0x03ab, 0x0000, 0x038f, 0x0000, 0x0000, 0x0385, 0x2015,
1254 0x0000, 0x03ac, 0x03ad, 0x03ae, 0x03af, 0x03ca, 0x0390, 0x03cc,
1255 0x03cd, 0x03cb, 0x03b0, 0x03ce, 0x0000, 0x0000, 0x0000, 0x0000,
1256 0x0000, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397,
1257 0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f,
1258 0x03a0, 0x03a1, 0x03a3, 0x0000, 0x03a4, 0x03a5, 0x03a6, 0x03a7,
1259 0x03a8, 0x03a9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
1260 0x0000, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7,
1261 0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf,
1262 0x03c0, 0x03c1, 0x03c3, 0x03c2, 0x03c4, 0x03c5, 0x03c6, 0x03c7,
1263 0x03c8, 0x03c9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
1267 0x0000, 0x23B7, 0x250C, 0x2500, 0x2320, 0x2321, 0x2502, 0x23A1,
1268 0x23A3, 0x23A4, 0x23A6, 0x239B, 0x239D, 0x239E, 0x23A0, 0x23A8,
1269 0x23AC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
1270 0x0000, 0x0000, 0x0000, 0x0000, 0x2264, 0x2260, 0x2265, 0x222B,
1271 0x2234, 0x221D, 0x221E, 0x0000, 0x0000, 0x2207, 0x0000, 0x0000,
1272 0x223C, 0x2243, 0x0000, 0x0000, 0x0000, 0x21D4, 0x21D2, 0x2261,
1273 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x221A, 0x0000,
1274 0x0000, 0x0000, 0x2282, 0x2283, 0x2229, 0x222A, 0x2227, 0x2228,
1275 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
1276 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2202,
1277 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0192, 0x0000,
1278 0x0000, 0x0000, 0x0000, 0x2190, 0x2191, 0x2192, 0x2193, 0x0000
1282 0x25C6, 0x2592, 0x2409, 0x240C, 0x240D, 0x240A, 0x0000, 0x0000,
1283 0x2424, 0x240B, 0x2518, 0x2510, 0x250C, 0x2514, 0x253C, 0x23BA,
1284 0x23BB, 0x2500, 0x23BC, 0x23BD, 0x251C, 0x2524, 0x2534, 0x252C,
1285 0x2502, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
1289 0x0000, 0x2003, 0x2002, 0x2004, 0x2005, 0x2007, 0x2008, 0x2009,
1290 0x200a, 0x2014, 0x2013, 0x0000, 0x0000, 0x0000, 0x2026, 0x2025,
1291 0x2153, 0x2154, 0x2155, 0x2156, 0x2157, 0x2158, 0x2159, 0x215a,
1292 0x2105, 0x0000, 0x0000, 0x2012, 0x2329, 0x0000, 0x232a, 0x0000,
1293 0x0000, 0x0000, 0x0000, 0x215b, 0x215c, 0x215d, 0x215e, 0x0000,
1294 0x0000, 0x2122, 0x2613, 0x0000, 0x25c1, 0x25b7, 0x25cb, 0x25af,
1295 0x2018, 0x2019, 0x201c, 0x201d, 0x211e, 0x0000, 0x2032, 0x2033,
1296 0x0000, 0x271d, 0x0000, 0x25ac, 0x25c0, 0x25b6, 0x25cf, 0x25ae,
1297 0x25e6, 0x25ab, 0x25ad, 0x25b3, 0x25bd, 0x2606, 0x2022, 0x25aa,
1298 0x25b2, 0x25bc, 0x261c, 0x261e, 0x2663, 0x2666, 0x2665, 0x0000,
1299 0x2720, 0x2020, 0x2021, 0x2713, 0x2717, 0x266f, 0x266d, 0x2642,
1300 0x2640, 0x260e, 0x2315, 0x2117, 0x2038, 0x201a, 0x201e, 0x0000
1304 0x0000, 0x0000, 0x0000, 0x003c, 0x0000, 0x0000, 0x003e, 0x0000,
1305 0x2228, 0x2227, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
1306 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
1307 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
1308 0x00af, 0x0000, 0x22a5, 0x2229, 0x230a, 0x0000, 0x005f, 0x0000,
1309 0x0000, 0x0000, 0x2218, 0x0000, 0x2395, 0x0000, 0x22a4, 0x25cb,
1310 0x0000, 0x0000, 0x0000, 0x2308, 0x0000, 0x0000, 0x222a, 0x0000,
1311 0x2283, 0x0000, 0x2282, 0x0000, 0x22a2, 0x0000, 0x0000, 0x0000,
1312 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
1313 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
1314 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
1315 0x0000, 0x0000, 0x0000, 0x0000, 0x22a3, 0x0000, 0x0000, 0x0000
1319 0x0000, 0x3131, 0x3132, 0x3133, 0x3134, 0x3135, 0x3136, 0x3137,
1320 0x3138, 0x3139, 0x313a, 0x313b, 0x313c, 0x313d, 0x313e, 0x313f,
1321 0x3140, 0x3141, 0x3142, 0x3143, 0x3144, 0x3145, 0x3146, 0x3147,
1322 0x3148, 0x3149, 0x314a, 0x314b, 0x314c, 0x314d, 0x314e, 0x314f,
1323 0x3150, 0x3151, 0x3152, 0x3153, 0x3154, 0x3155, 0x3156, 0x3157,
1324 0x3158, 0x3159, 0x315a, 0x315b, 0x315c, 0x315d, 0x315e, 0x315f,
1325 0x3160, 0x3161, 0x3162, 0x3163, 0x11a8, 0x11a9, 0x11aa, 0x11ab,
1326 0x11ac, 0x11ad, 0x11ae, 0x11af, 0x11b0, 0x11b1, 0x11b2, 0x11b3,
1327 0x11b4, 0x11b5, 0x11b6, 0x11b7, 0x11b8, 0x11b9, 0x11ba, 0x11bb,
1328 0x11bc, 0x11bd, 0x11be, 0x11bf, 0x11c0, 0x11c1, 0x11c2, 0x316d,
1329 0x3171, 0x3178, 0x317f, 0x3181, 0x3184, 0x3186, 0x318d, 0x318e,
1330 0x11eb, 0x11f0, 0x11f9, 0x0000, 0x0000, 0x0000, 0x0000, 0x20a9
1338 if (byte4 > 0xa0 && byte4 < 0xe0)
1340 else if (byte4 == 0x7e)
1341 return QChar(0x203e);
1386 int &code, Qt::KeyboardModifiers &modifiers,
1395 if (count == 0 && keysym < 0xff00) {
1396 unsigned char byte3 = (
unsigned char)(keysym >> 8);
1403 mib = byte3 + 4;
break;
1420 #if !defined(QT_NO_XIM) 1425 if (keysym >= 0x20a0 && keysym <= 0x20ac) {
1428 converted = (
uint)keysym;
1438 chars[0] = (
unsigned char) (keysym & 0xff);
1441 }
else if (keysym >= 0x1000000 && keysym <= 0x100ffff) {
1442 converted = (
ushort) (keysym - 0x1000000);
1445 if (count < (
int)chars.
size()-1)
1446 chars[count] =
'\0';
1449 if (!mapper && converted.
unicode() != 0x0) {
1451 }
else if (!chars.
isEmpty()) {
1463 modifiers =
X11->translateModifiers(xmodifiers);
1473 if (keysym < 128 || (keysym < 256 && (!qt_input_mapper || qt_input_mapper->
mibEnum()==4))) {
1475 code = isprint((
int)keysym) ? toupper((
int)keysym) : 0;
1476 }
else if (keysym >= XK_F1 && keysym <= XK_F35) {
1479 }
else if (keysym >= XK_KP_Space && keysym <= XK_KP_9) {
1480 if (keysym >= XK_KP_0) {
1482 code =
Qt::Key_0 + ((int)keysym - XK_KP_0);
1511 Qt::KeyboardModifiers &modifiers,
1514 bool statefulTranslation)
1516 XKeyEvent xkeyevent =
event->xkey;
1517 int keycode =
event->xkey.keycode;
1520 uint keystate =
event->xkey.state;
1524 static int directionKeyEvent = 0;
1525 static unsigned int lastWinId = 0;
1531 code = directionKeyEvent;
1533 directionKeyEvent = 0;
1537 directionKeyEvent = 0;
1548 count = XLookupString(&xkeyevent, chars.
data(), chars.
size(), &
keysym, 0);
1549 if (count && !keycode) {
1552 qt_ximComposingKeycode = 0;
1567 if (!directionKeyEvent) {
1568 directionKeyEvent =
keysym;
1579 if (directionKeyEvent && lastWinId == keyWidget->
internalWinId()) {
1580 if ((
keysym == XK_Shift_L && directionKeyEvent == XK_Control_L)
1581 || (
keysym == XK_Control_L && directionKeyEvent == XK_Shift_L)) {
1583 }
else if ((
keysym == XK_Shift_R && directionKeyEvent == XK_Control_R)
1584 || (
keysym == XK_Control_R && directionKeyEvent == XK_Shift_R)) {
1609 #if defined(Q_C_CALLBACKS) 1622 if (event->xkey.window != data->
window ||
1623 event->xkey.keycode != data->
keycode) {
1632 return (! data->
error);
1653 event->xkey.window == data->
window &&
1654 event->xkey.keycode == data->
keycode);
1657 #if defined(Q_C_CALLBACKS) 1665 Qt::KeyboardModifiers modifiers;
1684 auto_repeat_data.
window =
event->xkey.window;
1685 auto_repeat_data.
keycode =
event->xkey.keycode;
1686 auto_repeat_data.
timestamp =
event->xkey.time;
1688 static uint curr_autorep = 0;
1690 if (curr_autorep == event->xkey.keycode) {
1698 auto_repeat_data.
release =
true;
1699 auto_repeat_data.
error =
false;
1706 XPutBackEvent(dpy,&nextpress);
1708 curr_autorep = autor ?
event->xkey.keycode : 0;
1711 #if defined QT3_SUPPORT && !defined(QT_NO_SHORTCUT) 1717 event->xkey.keycode,
keysym,
event->xkey.state);
1766 if (!XCheckTypedWindowEvent(dpy,event->xkey.window,
1769 if (!XCheckTypedWindowEvent(dpy,event->xkey.window,
1771 XPutBackEvent(dpy, &evRelease);
1775 int codeIntern = -1;
1776 int countIntern = 0;
1777 Qt::KeyboardModifiers modifiersIntern;
1779 KeySym keySymIntern;
1781 modifiersIntern, codeIntern, t);
1784 bool stopCompression =
1793 || (codeIntern == 0)
1797 if (modifiersIntern == modifiers && !textIntern.
isEmpty() && !stopCompression) {
1799 count += countIntern;
1801 XPutBackEvent(dpy, &evPress);
1802 XPutBackEvent(dpy, &evRelease);
1819 auto_repeat_data.
release =
false;
1820 auto_repeat_data.
error =
false;
1836 event->xkey.keycode,
keysym,
event->xkey.state);
1841 const QString &text,
bool autorepeat,
int count,
1865 nativeScanCode, nativeVirtualKey, nativeModifiers);
The QVariant class acts like a union for the most common Qt data types.
#define XF86XK_ScreenSaver
Qt::LayoutDirection textDirection() const
Returns the text direction of the language.
#define QTOPIAXK_Context3
The QKeyEvent class describes a key event.
static const unsigned short katakanaKeysymsToUnicode[]
#define QT_END_NAMESPACE
This macro expands to.
#define XF86XK_RotateWindows
char * data()
Returns a pointer to the data stored in the byte array.
const QChar at(int i) const
Returns the character at the given index position in the string.
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
bool isNull() const
Returns true if this is a NULL variant, false otherwise.
#define XF86XK_RotationKB
The QByteArray class provides an array of bytes.
int length() const
Returns the number of characters in this string.
static Bool qt_keypress_scanner(Display *, XEvent *event, XPointer arg)
#define XF86XK_AudioMedia
#define XF86XK_ContrastAdjust
#define XF86XK_Calculator
#define XF86XK_MonBrightnessDown
static const unsigned short koreanKeysymsToUnicode[]
#define XF86XK_AudioRepeat
static QApplicationPrivate * instance()
long ASN1_INTEGER_get ASN1_INTEGER * a
int count(const T &t) const
Returns the number of occurrences of value in the list.
QLocale keyboardInputLocale
QString name() const
Returns the language and country of this locale as a string of the form "language_country", where language is a lowercase, two-letter ISO 639 language code, and country is an uppercase, two- or three-letter ISO 3166 country code.
QLocale q_getKeyboardLocale(const QByteArray &layoutName, const QByteArray &variantName)
The QString class provides a Unicode character string.
static const unsigned int KeyTbl[]
The QObject class is the base class of all Qt objects.
The QChar class provides a 16-bit Unicode character.
static const unsigned short cyrillicKeysymsToUnicode[]
Q_CORE_EXPORT QTextStream & hex(QTextStream &s)
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
bool qt_sendSpontaneousEvent(QObject *, QEvent *)
Q_CORE_EXPORT void qDebug(const char *,...)
static QString translateKeySym(KeySym keysym, uint xmodifiers, int &code, Qt::KeyboardModifiers &modifiers, QByteArray &chars, int &count)
QList< int > possibleKeys(QKeyEvent *e)
#define XF86XK_AudioRandomPlay
#define XF86XK_AddFavorite
QLocale::Language language
#define QT_BEGIN_NAMESPACE
This macro expands to.
#define XF86XK_BrightnessAdjust
static const unsigned short aplKeysymsToUnicode[]
#define XF86XK_AudioRaiseVolume
const QChar * unicode() const
Returns a '\0'-terminated Unicode representation of the string.
#define QTOPIAXK_Context4
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static const unsigned short publishingKeysymsToUnicode[]
QTextCodec * qt_input_mapper
#define XF86XK_Calculater
#define XF86XK_AudioCycleTrack
#define XF86XK_BackForward
const T & at(int i) const
Returns the item at index position i in the list.
static QByteArray fromRawData(const char *, int size)
Constructs a QByteArray that uses the first size bytes of the data array.
#define XF86XK_ApplicationLeft
static bool translateKeyEventInternal(EventHandlerCallRef er, EventRef keyEvent, int *qtKey, QChar *outChar, Qt::KeyboardModifiers *outModifiers, bool *outHandled)
virtual int mibEnum() const =0
Subclasses of QTextCodec must reimplement this function.
static const char * data(const QByteArray &arr)
#define XF86XK_KbdBrightnessUp
bool translateKeyEvent(QWidget *receiver, const MSG &msg, bool grab)
QChar toUpper() const
Returns the uppercase equivalent if the character is lowercase or titlecase; otherwise returns the ch...
#define XF86XK_AudioForward
bool qt_use_rtl_extensions
static QTextCodec * codecForMib(int mib)
Returns the QTextCodec which matches the MIBenum mib.
static const unsigned short technicalKeysymsToUnicode[]
#define XF86XK_MonBrightnessUp
#define XF86XK_AudioLowerVolume
#define XF86XK_KbdBrightnessDown
QPoint center() const
Returns the center point of the rectangle.
QString toUnicode(const QByteArray &) const
Converts a from the encoding of this codec to Unicode, and returns the result in a QString...
QList< QByteArray > split(char sep) const
Splits the byte array into subarrays wherever sep occurs, and returns the list of those arrays...
#define QTOPIAXK_Context1
uint qstrlen(const char *str)
#define XF86XK_MailForward
#define XF86XK_OfficeHome
static QLocale c()
Returns a QLocale object initialized to the "C" locale.
static int qt_XTranslateKey(register QXCoreDesc *dpy, KeyCode keycode, register unsigned int modifiers, unsigned int *modifiers_return, KeySym *keysym_return)
static struct @202 xkbLayoutData[]
#define XF86XK_AudioRewind
#define XF86XK_KbdLightOnOff
bool qt_sm_blockUserInput
Type
This enum type defines the valid event types in Qt.
static Bool qt_keyrelease_scanner(Display *, XEvent *event, XPointer arg)
static QChar keysymToUnicode(unsigned char byte3, unsigned char byte4)
QRect toRect() const
Returns the variant as a QRect if the variant has type() Rect ; otherwise returns an invalid QRect...
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
#define XF86XK_AudioRecord
The QPoint class defines a point in the plane using integer precision.
void resize(int size)
Sets the size of the byte array to size bytes.
static const unsigned short greekKeysymsToUnicode[]
#define XF86XK_SplitScreen
#define XF86XK_ApplicationRight
int size() const
Returns the number of bytes in this byte array.
#define XF86XK_RotationPB
static bool sendKeyEvent(QWidget *widget, bool grab, QEvent::Type type, int code, Qt::KeyboardModifiers modifiers, const QString &text, bool autorepeat, int count, quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers, bool *unusedExceptForCocoa=0)
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
The QInputContext class abstracts the input method dependent data and composing state.
The QTextCodec class provides conversions between text encodings.
static const KeyPair *const end
The QEvent class is the base class of all event classes.
Type type() const
Returns the event type.
Qt::LayoutDirection keyboardInputDirection
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
#define SETMASK(sym, mask)
int qt_ximComposingKeycode
#define XF86XK_MyComputer
void clear()
Clears the contents of the byte array and makes it empty.
static const unsigned short specialKeysymsToUnicode[]
static QPoint pos()
Returns the position of the cursor (hot spot) in global screen coordinates.
#define QTOPIAXK_Context2
uchar qt_mode_switch_mask