Qt 4.8
qxcbkeyboard.cpp
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
5 **
6 ** This file is part of the plugins of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24 **
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28 **
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 #include "qxcbkeyboard.h"
43 
44 #include <xcb/xcb_keysyms.h>
45 
46 #include <X11/keysym.h>
47 
48 #include <QtGui/QWindowSystemInterface>
49 #include <QtCore/QTextCodec>
50 
51 #include <stdio.h>
52 
53 #ifndef XK_ISO_Left_Tab
54 #define XK_ISO_Left_Tab 0xFE20
55 #endif
56 
57 #ifndef XK_dead_hook
58 #define XK_dead_hook 0xFE61
59 #endif
60 
61 #ifndef XK_dead_horn
62 #define XK_dead_horn 0xFE62
63 #endif
64 
65 #ifndef XK_Codeinput
66 #define XK_Codeinput 0xFF37
67 #endif
68 
69 #ifndef XK_Kanji_Bangou
70 #define XK_Kanji_Bangou 0xFF37 /* same as codeinput */
71 #endif
72 
73 // Fix old X libraries
74 #ifndef XK_KP_Home
75 #define XK_KP_Home 0xFF95
76 #endif
77 #ifndef XK_KP_Left
78 #define XK_KP_Left 0xFF96
79 #endif
80 #ifndef XK_KP_Up
81 #define XK_KP_Up 0xFF97
82 #endif
83 #ifndef XK_KP_Right
84 #define XK_KP_Right 0xFF98
85 #endif
86 #ifndef XK_KP_Down
87 #define XK_KP_Down 0xFF99
88 #endif
89 #ifndef XK_KP_Prior
90 #define XK_KP_Prior 0xFF9A
91 #endif
92 #ifndef XK_KP_Next
93 #define XK_KP_Next 0xFF9B
94 #endif
95 #ifndef XK_KP_End
96 #define XK_KP_End 0xFF9C
97 #endif
98 #ifndef XK_KP_Insert
99 #define XK_KP_Insert 0xFF9E
100 #endif
101 #ifndef XK_KP_Delete
102 #define XK_KP_Delete 0xFF9F
103 #endif
104 
105 // the next lines are taken on 10/2009 from X.org (X11/XF86keysym.h), defining some special
106 // multimedia keys. They are included here as not every system has them.
107 #define XF86XK_MonBrightnessUp 0x1008FF02
108 #define XF86XK_MonBrightnessDown 0x1008FF03
109 #define XF86XK_KbdLightOnOff 0x1008FF04
110 #define XF86XK_KbdBrightnessUp 0x1008FF05
111 #define XF86XK_KbdBrightnessDown 0x1008FF06
112 #define XF86XK_Standby 0x1008FF10
113 #define XF86XK_AudioLowerVolume 0x1008FF11
114 #define XF86XK_AudioMute 0x1008FF12
115 #define XF86XK_AudioRaiseVolume 0x1008FF13
116 #define XF86XK_AudioPlay 0x1008FF14
117 #define XF86XK_AudioStop 0x1008FF15
118 #define XF86XK_AudioPrev 0x1008FF16
119 #define XF86XK_AudioNext 0x1008FF17
120 #define XF86XK_HomePage 0x1008FF18
121 #define XF86XK_Mail 0x1008FF19
122 #define XF86XK_Start 0x1008FF1A
123 #define XF86XK_Search 0x1008FF1B
124 #define XF86XK_AudioRecord 0x1008FF1C
125 #define XF86XK_Calculator 0x1008FF1D
126 #define XF86XK_Memo 0x1008FF1E
127 #define XF86XK_ToDoList 0x1008FF1F
128 #define XF86XK_Calendar 0x1008FF20
129 #define XF86XK_PowerDown 0x1008FF21
130 #define XF86XK_ContrastAdjust 0x1008FF22
131 #define XF86XK_Back 0x1008FF26
132 #define XF86XK_Forward 0x1008FF27
133 #define XF86XK_Stop 0x1008FF28
134 #define XF86XK_Refresh 0x1008FF29
135 #define XF86XK_PowerOff 0x1008FF2A
136 #define XF86XK_WakeUp 0x1008FF2B
137 #define XF86XK_Eject 0x1008FF2C
138 #define XF86XK_ScreenSaver 0x1008FF2D
139 #define XF86XK_WWW 0x1008FF2E
140 #define XF86XK_Sleep 0x1008FF2F
141 #define XF86XK_Favorites 0x1008FF30
142 #define XF86XK_AudioPause 0x1008FF31
143 #define XF86XK_AudioMedia 0x1008FF32
144 #define XF86XK_MyComputer 0x1008FF33
145 #define XF86XK_LightBulb 0x1008FF35
146 #define XF86XK_Shop 0x1008FF36
147 #define XF86XK_History 0x1008FF37
148 #define XF86XK_OpenURL 0x1008FF38
149 #define XF86XK_AddFavorite 0x1008FF39
150 #define XF86XK_HotLinks 0x1008FF3A
151 #define XF86XK_BrightnessAdjust 0x1008FF3B
152 #define XF86XK_Finance 0x1008FF3C
153 #define XF86XK_Community 0x1008FF3D
154 #define XF86XK_AudioRewind 0x1008FF3E
155 #define XF86XK_BackForward 0x1008FF3F
156 #define XF86XK_Launch0 0x1008FF40
157 #define XF86XK_Launch1 0x1008FF41
158 #define XF86XK_Launch2 0x1008FF42
159 #define XF86XK_Launch3 0x1008FF43
160 #define XF86XK_Launch4 0x1008FF44
161 #define XF86XK_Launch5 0x1008FF45
162 #define XF86XK_Launch6 0x1008FF46
163 #define XF86XK_Launch7 0x1008FF47
164 #define XF86XK_Launch8 0x1008FF48
165 #define XF86XK_Launch9 0x1008FF49
166 #define XF86XK_LaunchA 0x1008FF4A
167 #define XF86XK_LaunchB 0x1008FF4B
168 #define XF86XK_LaunchC 0x1008FF4C
169 #define XF86XK_LaunchD 0x1008FF4D
170 #define XF86XK_LaunchE 0x1008FF4E
171 #define XF86XK_LaunchF 0x1008FF4F
172 #define XF86XK_ApplicationLeft 0x1008FF50
173 #define XF86XK_ApplicationRight 0x1008FF51
174 #define XF86XK_Book 0x1008FF52
175 #define XF86XK_CD 0x1008FF53
176 #define XF86XK_Calculater 0x1008FF54
177 #define XF86XK_Clear 0x1008FF55
178 #define XF86XK_ClearGrab 0x1008FE21
179 #define XF86XK_Close 0x1008FF56
180 #define XF86XK_Copy 0x1008FF57
181 #define XF86XK_Cut 0x1008FF58
182 #define XF86XK_Display 0x1008FF59
183 #define XF86XK_DOS 0x1008FF5A
184 #define XF86XK_Documents 0x1008FF5B
185 #define XF86XK_Excel 0x1008FF5C
186 #define XF86XK_Explorer 0x1008FF5D
187 #define XF86XK_Game 0x1008FF5E
188 #define XF86XK_Go 0x1008FF5F
189 #define XF86XK_iTouch 0x1008FF60
190 #define XF86XK_LogOff 0x1008FF61
191 #define XF86XK_Market 0x1008FF62
192 #define XF86XK_Meeting 0x1008FF63
193 #define XF86XK_MenuKB 0x1008FF65
194 #define XF86XK_MenuPB 0x1008FF66
195 #define XF86XK_MySites 0x1008FF67
196 #define XF86XK_News 0x1008FF69
197 #define XF86XK_OfficeHome 0x1008FF6A
198 #define XF86XK_Option 0x1008FF6C
199 #define XF86XK_Paste 0x1008FF6D
200 #define XF86XK_Phone 0x1008FF6E
201 #define XF86XK_Reply 0x1008FF72
202 #define XF86XK_Reload 0x1008FF73
203 #define XF86XK_RotateWindows 0x1008FF74
204 #define XF86XK_RotationPB 0x1008FF75
205 #define XF86XK_RotationKB 0x1008FF76
206 #define XF86XK_Save 0x1008FF77
207 #define XF86XK_Send 0x1008FF7B
208 #define XF86XK_Spell 0x1008FF7C
209 #define XF86XK_SplitScreen 0x1008FF7D
210 #define XF86XK_Support 0x1008FF7E
211 #define XF86XK_TaskPane 0x1008FF7F
212 #define XF86XK_Terminal 0x1008FF80
213 #define XF86XK_Tools 0x1008FF81
214 #define XF86XK_Travel 0x1008FF82
215 #define XF86XK_Video 0x1008FF87
216 #define XF86XK_Word 0x1008FF89
217 #define XF86XK_Xfer 0x1008FF8A
218 #define XF86XK_ZoomIn 0x1008FF8B
219 #define XF86XK_ZoomOut 0x1008FF8C
220 #define XF86XK_Away 0x1008FF8D
221 #define XF86XK_Messenger 0x1008FF8E
222 #define XF86XK_WebCam 0x1008FF8F
223 #define XF86XK_MailForward 0x1008FF90
224 #define XF86XK_Pictures 0x1008FF91
225 #define XF86XK_Music 0x1008FF92
226 #define XF86XK_Battery 0x1008FF93
227 #define XF86XK_Bluetooth 0x1008FF94
228 #define XF86XK_WLAN 0x1008FF95
229 #define XF86XK_UWB 0x1008FF96
230 #define XF86XK_AudioForward 0x1008FF97
231 #define XF86XK_AudioRepeat 0x1008FF98
232 #define XF86XK_AudioRandomPlay 0x1008FF99
233 #define XF86XK_Subtitle 0x1008FF9A
234 #define XF86XK_AudioCycleTrack 0x1008FF9B
235 #define XF86XK_Time 0x1008FF9F
236 #define XF86XK_Select 0x1008FFA0
237 #define XF86XK_View 0x1008FFA1
238 #define XF86XK_TopMenu 0x1008FFA2
239 #define XF86XK_Suspend 0x1008FFA7
240 #define XF86XK_Hibernate 0x1008FFA8
241 
242 
243 // end of XF86keysyms.h
244 
245 // Special keys used by Qtopia, mapped into the X11 private keypad range.
246 #define QTOPIAXK_Select 0x11000601
247 #define QTOPIAXK_Yes 0x11000602
248 #define QTOPIAXK_No 0x11000603
249 #define QTOPIAXK_Cancel 0x11000604
250 #define QTOPIAXK_Printer 0x11000605
251 #define QTOPIAXK_Execute 0x11000606
252 #define QTOPIAXK_Sleep 0x11000607
253 #define QTOPIAXK_Play 0x11000608
254 #define QTOPIAXK_Zoom 0x11000609
255 #define QTOPIAXK_Context1 0x1100060A
256 #define QTOPIAXK_Context2 0x1100060B
257 #define QTOPIAXK_Context3 0x1100060C
258 #define QTOPIAXK_Context4 0x1100060D
259 #define QTOPIAXK_Call 0x1100060E
260 #define QTOPIAXK_Hangup 0x1100060F
261 #define QTOPIAXK_Flip 0x11000610
262 
263 // keyboard mapping table
264 static const unsigned int KeyTbl[] = {
265 
266  // misc keys
267 
268  XK_Escape, Qt::Key_Escape,
269  XK_Tab, Qt::Key_Tab,
271  XK_BackSpace, Qt::Key_Backspace,
272  XK_Return, Qt::Key_Return,
273  XK_Insert, Qt::Key_Insert,
274  XK_Delete, Qt::Key_Delete,
275  XK_Clear, Qt::Key_Delete,
276  XK_Pause, Qt::Key_Pause,
277  XK_Print, Qt::Key_Print,
278  0x1005FF60, Qt::Key_SysReq, // hardcoded Sun SysReq
279  0x1007ff00, Qt::Key_SysReq, // hardcoded X386 SysReq
280 
281  // cursor movement
282 
283  XK_Home, Qt::Key_Home,
284  XK_End, Qt::Key_End,
285  XK_Left, Qt::Key_Left,
286  XK_Up, Qt::Key_Up,
287  XK_Right, Qt::Key_Right,
288  XK_Down, Qt::Key_Down,
289  XK_Prior, Qt::Key_PageUp,
290  XK_Next, Qt::Key_PageDown,
291 
292  // modifiers
293 
294  XK_Shift_L, Qt::Key_Shift,
295  XK_Shift_R, Qt::Key_Shift,
296  XK_Shift_Lock, Qt::Key_Shift,
297  XK_Control_L, Qt::Key_Control,
298  XK_Control_R, Qt::Key_Control,
299  XK_Meta_L, Qt::Key_Meta,
300  XK_Meta_R, Qt::Key_Meta,
301  XK_Alt_L, Qt::Key_Alt,
302  XK_Alt_R, Qt::Key_Alt,
303  XK_Caps_Lock, Qt::Key_CapsLock,
304  XK_Num_Lock, Qt::Key_NumLock,
305  XK_Scroll_Lock, Qt::Key_ScrollLock,
306  XK_Super_L, Qt::Key_Super_L,
307  XK_Super_R, Qt::Key_Super_R,
308  XK_Menu, Qt::Key_Menu,
309  XK_Hyper_L, Qt::Key_Hyper_L,
310  XK_Hyper_R, Qt::Key_Hyper_R,
311  XK_Help, Qt::Key_Help,
312  0x1000FF74, Qt::Key_Backtab, // hardcoded HP backtab
313  0x1005FF10, Qt::Key_F11, // hardcoded Sun F36 (labeled F11)
314  0x1005FF11, Qt::Key_F12, // hardcoded Sun F37 (labeled F12)
315 
316  // numeric and function keypad keys
317 
318  XK_KP_Space, Qt::Key_Space,
319  XK_KP_Tab, Qt::Key_Tab,
320  XK_KP_Enter, Qt::Key_Enter,
321  //XK_KP_F1, Qt::Key_F1,
322  //XK_KP_F2, Qt::Key_F2,
323  //XK_KP_F3, Qt::Key_F3,
324  //XK_KP_F4, Qt::Key_F4,
333  XK_KP_Begin, Qt::Key_Clear,
336  XK_KP_Equal, Qt::Key_Equal,
337  XK_KP_Multiply, Qt::Key_Asterisk,
338  XK_KP_Add, Qt::Key_Plus,
339  XK_KP_Separator, Qt::Key_Comma,
340  XK_KP_Subtract, Qt::Key_Minus,
341  XK_KP_Decimal, Qt::Key_Period,
342  XK_KP_Divide, Qt::Key_Slash,
343 
344  // International input method support keys
345 
346  // International & multi-key character composition
347  XK_ISO_Level3_Shift, Qt::Key_AltGr,
348  XK_Multi_key, Qt::Key_Multi_key,
350  XK_SingleCandidate, Qt::Key_SingleCandidate,
351  XK_MultipleCandidate, Qt::Key_MultipleCandidate,
352  XK_PreviousCandidate, Qt::Key_PreviousCandidate,
353 
354  // Misc Functions
355  XK_Mode_switch, Qt::Key_Mode_switch,
356  XK_script_switch, Qt::Key_Mode_switch,
357 
358  // Japanese keyboard support
359  XK_Kanji, Qt::Key_Kanji,
360  XK_Muhenkan, Qt::Key_Muhenkan,
361  //XK_Henkan_Mode, Qt::Key_Henkan_Mode,
362  XK_Henkan_Mode, Qt::Key_Henkan,
363  XK_Henkan, Qt::Key_Henkan,
364  XK_Romaji, Qt::Key_Romaji,
365  XK_Hiragana, Qt::Key_Hiragana,
366  XK_Katakana, Qt::Key_Katakana,
367  XK_Hiragana_Katakana, Qt::Key_Hiragana_Katakana,
368  XK_Zenkaku, Qt::Key_Zenkaku,
369  XK_Hankaku, Qt::Key_Hankaku,
370  XK_Zenkaku_Hankaku, Qt::Key_Zenkaku_Hankaku,
371  XK_Touroku, Qt::Key_Touroku,
372  XK_Massyo, Qt::Key_Massyo,
373  XK_Kana_Lock, Qt::Key_Kana_Lock,
374  XK_Kana_Shift, Qt::Key_Kana_Shift,
375  XK_Eisu_Shift, Qt::Key_Eisu_Shift,
376  XK_Eisu_toggle, Qt::Key_Eisu_toggle,
377  //XK_Kanji_Bangou, Qt::Key_Kanji_Bangou,
378  //XK_Zen_Koho, Qt::Key_Zen_Koho,
379  //XK_Mae_Koho, Qt::Key_Mae_Koho,
381  XK_Zen_Koho, Qt::Key_MultipleCandidate,
382  XK_Mae_Koho, Qt::Key_PreviousCandidate,
383 
384 #ifdef XK_KOREAN
385  // Korean keyboard support
386  XK_Hangul, Qt::Key_Hangul,
387  XK_Hangul_Start, Qt::Key_Hangul_Start,
388  XK_Hangul_End, Qt::Key_Hangul_End,
389  XK_Hangul_Hanja, Qt::Key_Hangul_Hanja,
390  XK_Hangul_Jamo, Qt::Key_Hangul_Jamo,
391  XK_Hangul_Romaja, Qt::Key_Hangul_Romaja,
392  //XK_Hangul_Codeinput, Qt::Key_Hangul_Codeinput,
393  XK_Hangul_Codeinput, Qt::Key_Codeinput,
394  XK_Hangul_Jeonja, Qt::Key_Hangul_Jeonja,
395  XK_Hangul_Banja, Qt::Key_Hangul_Banja,
396  XK_Hangul_PreHanja, Qt::Key_Hangul_PreHanja,
397  XK_Hangul_PostHanja, Qt::Key_Hangul_PostHanja,
398  //XK_Hangul_SingleCandidate,Qt::Key_Hangul_SingleCandidate,
399  //XK_Hangul_MultipleCandidate,Qt::Key_Hangul_MultipleCandidate,
400  //XK_Hangul_PreviousCandidate,Qt::Key_Hangul_PreviousCandidate,
401  XK_Hangul_SingleCandidate, Qt::Key_SingleCandidate,
402  XK_Hangul_MultipleCandidate,Qt::Key_MultipleCandidate,
403  XK_Hangul_PreviousCandidate,Qt::Key_PreviousCandidate,
404  XK_Hangul_Special, Qt::Key_Hangul_Special,
405  //XK_Hangul_switch, Qt::Key_Hangul_switch,
406  XK_Hangul_switch, Qt::Key_Mode_switch,
407 #endif // XK_KOREAN
408 
409  // dead keys
410  XK_dead_grave, Qt::Key_Dead_Grave,
411  XK_dead_acute, Qt::Key_Dead_Acute,
412  XK_dead_circumflex, Qt::Key_Dead_Circumflex,
413  XK_dead_tilde, Qt::Key_Dead_Tilde,
414  XK_dead_macron, Qt::Key_Dead_Macron,
415  XK_dead_breve, Qt::Key_Dead_Breve,
416  XK_dead_abovedot, Qt::Key_Dead_Abovedot,
417  XK_dead_diaeresis, Qt::Key_Dead_Diaeresis,
418  XK_dead_abovering, Qt::Key_Dead_Abovering,
419  XK_dead_doubleacute, Qt::Key_Dead_Doubleacute,
420  XK_dead_caron, Qt::Key_Dead_Caron,
421  XK_dead_cedilla, Qt::Key_Dead_Cedilla,
422  XK_dead_ogonek, Qt::Key_Dead_Ogonek,
423  XK_dead_iota, Qt::Key_Dead_Iota,
424  XK_dead_voiced_sound, Qt::Key_Dead_Voiced_Sound,
425  XK_dead_semivoiced_sound, Qt::Key_Dead_Semivoiced_Sound,
426  XK_dead_belowdot, Qt::Key_Dead_Belowdot,
429 
430  // Special keys from X.org - This include multimedia keys,
431  // wireless/bluetooth/uwb keys, special launcher keys, etc.
450  XF86XK_MyComputer, Qt::Key_Launch0, // ### Qt 5: remap properly
549  XF86XK_Launch0, Qt::Key_Launch2, // ### Qt 5: remap properly
565 
566  // Qtopia keys
583 
584  0, 0
585 };
586 
587 static const unsigned short katakanaKeysymsToUnicode[] = {
588  0x0000, 0x3002, 0x300C, 0x300D, 0x3001, 0x30FB, 0x30F2, 0x30A1,
589  0x30A3, 0x30A5, 0x30A7, 0x30A9, 0x30E3, 0x30E5, 0x30E7, 0x30C3,
590  0x30FC, 0x30A2, 0x30A4, 0x30A6, 0x30A8, 0x30AA, 0x30AB, 0x30AD,
591  0x30AF, 0x30B1, 0x30B3, 0x30B5, 0x30B7, 0x30B9, 0x30BB, 0x30BD,
592  0x30BF, 0x30C1, 0x30C4, 0x30C6, 0x30C8, 0x30CA, 0x30CB, 0x30CC,
593  0x30CD, 0x30CE, 0x30CF, 0x30D2, 0x30D5, 0x30D8, 0x30DB, 0x30DE,
594  0x30DF, 0x30E0, 0x30E1, 0x30E2, 0x30E4, 0x30E6, 0x30E8, 0x30E9,
595  0x30EA, 0x30EB, 0x30EC, 0x30ED, 0x30EF, 0x30F3, 0x309B, 0x309C
596 };
597 
598 static const unsigned short cyrillicKeysymsToUnicode[] = {
599  0x0000, 0x0452, 0x0453, 0x0451, 0x0454, 0x0455, 0x0456, 0x0457,
600  0x0458, 0x0459, 0x045a, 0x045b, 0x045c, 0x0000, 0x045e, 0x045f,
601  0x2116, 0x0402, 0x0403, 0x0401, 0x0404, 0x0405, 0x0406, 0x0407,
602  0x0408, 0x0409, 0x040a, 0x040b, 0x040c, 0x0000, 0x040e, 0x040f,
603  0x044e, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433,
604  0x0445, 0x0438, 0x0439, 0x043a, 0x043b, 0x043c, 0x043d, 0x043e,
605  0x043f, 0x044f, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432,
606  0x044c, 0x044b, 0x0437, 0x0448, 0x044d, 0x0449, 0x0447, 0x044a,
607  0x042e, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413,
608  0x0425, 0x0418, 0x0419, 0x041a, 0x041b, 0x041c, 0x041d, 0x041e,
609  0x041f, 0x042f, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412,
610  0x042c, 0x042b, 0x0417, 0x0428, 0x042d, 0x0429, 0x0427, 0x042a
611 };
612 
613 static const unsigned short greekKeysymsToUnicode[] = {
614  0x0000, 0x0386, 0x0388, 0x0389, 0x038a, 0x03aa, 0x0000, 0x038c,
615  0x038e, 0x03ab, 0x0000, 0x038f, 0x0000, 0x0000, 0x0385, 0x2015,
616  0x0000, 0x03ac, 0x03ad, 0x03ae, 0x03af, 0x03ca, 0x0390, 0x03cc,
617  0x03cd, 0x03cb, 0x03b0, 0x03ce, 0x0000, 0x0000, 0x0000, 0x0000,
618  0x0000, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397,
619  0x0398, 0x0399, 0x039a, 0x039b, 0x039c, 0x039d, 0x039e, 0x039f,
620  0x03a0, 0x03a1, 0x03a3, 0x0000, 0x03a4, 0x03a5, 0x03a6, 0x03a7,
621  0x03a8, 0x03a9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
622  0x0000, 0x03b1, 0x03b2, 0x03b3, 0x03b4, 0x03b5, 0x03b6, 0x03b7,
623  0x03b8, 0x03b9, 0x03ba, 0x03bb, 0x03bc, 0x03bd, 0x03be, 0x03bf,
624  0x03c0, 0x03c1, 0x03c3, 0x03c2, 0x03c4, 0x03c5, 0x03c6, 0x03c7,
625  0x03c8, 0x03c9, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
626 };
627 
628 static const unsigned short technicalKeysymsToUnicode[] = {
629  0x0000, 0x23B7, 0x250C, 0x2500, 0x2320, 0x2321, 0x2502, 0x23A1,
630  0x23A3, 0x23A4, 0x23A6, 0x239B, 0x239D, 0x239E, 0x23A0, 0x23A8,
631  0x23AC, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
632  0x0000, 0x0000, 0x0000, 0x0000, 0x2264, 0x2260, 0x2265, 0x222B,
633  0x2234, 0x221D, 0x221E, 0x0000, 0x0000, 0x2207, 0x0000, 0x0000,
634  0x223C, 0x2243, 0x0000, 0x0000, 0x0000, 0x21D4, 0x21D2, 0x2261,
635  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x221A, 0x0000,
636  0x0000, 0x0000, 0x2282, 0x2283, 0x2229, 0x222A, 0x2227, 0x2228,
637  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
638  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x2202,
639  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0192, 0x0000,
640  0x0000, 0x0000, 0x0000, 0x2190, 0x2191, 0x2192, 0x2193, 0x0000
641 };
642 
643 static const unsigned short specialKeysymsToUnicode[] = {
644  0x25C6, 0x2592, 0x2409, 0x240C, 0x240D, 0x240A, 0x0000, 0x0000,
645  0x2424, 0x240B, 0x2518, 0x2510, 0x250C, 0x2514, 0x253C, 0x23BA,
646  0x23BB, 0x2500, 0x23BC, 0x23BD, 0x251C, 0x2524, 0x2534, 0x252C,
647  0x2502, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
648 };
649 
650 static const unsigned short publishingKeysymsToUnicode[] = {
651  0x0000, 0x2003, 0x2002, 0x2004, 0x2005, 0x2007, 0x2008, 0x2009,
652  0x200a, 0x2014, 0x2013, 0x0000, 0x0000, 0x0000, 0x2026, 0x2025,
653  0x2153, 0x2154, 0x2155, 0x2156, 0x2157, 0x2158, 0x2159, 0x215a,
654  0x2105, 0x0000, 0x0000, 0x2012, 0x2329, 0x0000, 0x232a, 0x0000,
655  0x0000, 0x0000, 0x0000, 0x215b, 0x215c, 0x215d, 0x215e, 0x0000,
656  0x0000, 0x2122, 0x2613, 0x0000, 0x25c1, 0x25b7, 0x25cb, 0x25af,
657  0x2018, 0x2019, 0x201c, 0x201d, 0x211e, 0x0000, 0x2032, 0x2033,
658  0x0000, 0x271d, 0x0000, 0x25ac, 0x25c0, 0x25b6, 0x25cf, 0x25ae,
659  0x25e6, 0x25ab, 0x25ad, 0x25b3, 0x25bd, 0x2606, 0x2022, 0x25aa,
660  0x25b2, 0x25bc, 0x261c, 0x261e, 0x2663, 0x2666, 0x2665, 0x0000,
661  0x2720, 0x2020, 0x2021, 0x2713, 0x2717, 0x266f, 0x266d, 0x2642,
662  0x2640, 0x260e, 0x2315, 0x2117, 0x2038, 0x201a, 0x201e, 0x0000
663 };
664 
665 static const unsigned short aplKeysymsToUnicode[] = {
666  0x0000, 0x0000, 0x0000, 0x003c, 0x0000, 0x0000, 0x003e, 0x0000,
667  0x2228, 0x2227, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
668  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
669  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
670  0x00af, 0x0000, 0x22a5, 0x2229, 0x230a, 0x0000, 0x005f, 0x0000,
671  0x0000, 0x0000, 0x2218, 0x0000, 0x2395, 0x0000, 0x22a4, 0x25cb,
672  0x0000, 0x0000, 0x0000, 0x2308, 0x0000, 0x0000, 0x222a, 0x0000,
673  0x2283, 0x0000, 0x2282, 0x0000, 0x22a2, 0x0000, 0x0000, 0x0000,
674  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
675  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
676  0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
677  0x0000, 0x0000, 0x0000, 0x0000, 0x22a3, 0x0000, 0x0000, 0x0000
678 };
679 
680 static const unsigned short koreanKeysymsToUnicode[] = {
681  0x0000, 0x3131, 0x3132, 0x3133, 0x3134, 0x3135, 0x3136, 0x3137,
682  0x3138, 0x3139, 0x313a, 0x313b, 0x313c, 0x313d, 0x313e, 0x313f,
683  0x3140, 0x3141, 0x3142, 0x3143, 0x3144, 0x3145, 0x3146, 0x3147,
684  0x3148, 0x3149, 0x314a, 0x314b, 0x314c, 0x314d, 0x314e, 0x314f,
685  0x3150, 0x3151, 0x3152, 0x3153, 0x3154, 0x3155, 0x3156, 0x3157,
686  0x3158, 0x3159, 0x315a, 0x315b, 0x315c, 0x315d, 0x315e, 0x315f,
687  0x3160, 0x3161, 0x3162, 0x3163, 0x11a8, 0x11a9, 0x11aa, 0x11ab,
688  0x11ac, 0x11ad, 0x11ae, 0x11af, 0x11b0, 0x11b1, 0x11b2, 0x11b3,
689  0x11b4, 0x11b5, 0x11b6, 0x11b7, 0x11b8, 0x11b9, 0x11ba, 0x11bb,
690  0x11bc, 0x11bd, 0x11be, 0x11bf, 0x11c0, 0x11c1, 0x11c2, 0x316d,
691  0x3171, 0x3178, 0x317f, 0x3181, 0x3184, 0x3186, 0x318d, 0x318e,
692  0x11eb, 0x11f0, 0x11f9, 0x0000, 0x0000, 0x0000, 0x0000, 0x20a9
693 };
694 
695 static QChar keysymToUnicode(unsigned char byte3, unsigned char byte4)
696 {
697  switch (byte3) {
698  case 0x04:
699  // katakana
700  if (byte4 > 0xa0 && byte4 < 0xe0)
701  return QChar(katakanaKeysymsToUnicode[byte4 - 0xa0]);
702  else if (byte4 == 0x7e)
703  return QChar(0x203e); // Overline
704  break;
705  case 0x06:
706  // russian, use lookup table
707  if (byte4 > 0xa0)
708  return QChar(cyrillicKeysymsToUnicode[byte4 - 0xa0]);
709  break;
710  case 0x07:
711  // greek
712  if (byte4 > 0xa0)
713  return QChar(greekKeysymsToUnicode[byte4 - 0xa0]);
714  break;
715  case 0x08:
716  // technical
717  if (byte4 > 0xa0)
718  return QChar(technicalKeysymsToUnicode[byte4 - 0xa0]);
719  break;
720  case 0x09:
721  // special
722  if (byte4 >= 0xe0)
723  return QChar(specialKeysymsToUnicode[byte4 - 0xe0]);
724  break;
725  case 0x0a:
726  // publishing
727  if (byte4 > 0xa0)
728  return QChar(publishingKeysymsToUnicode[byte4 - 0xa0]);
729  break;
730  case 0x0b:
731  // APL
732  if (byte4 > 0xa0)
733  return QChar(aplKeysymsToUnicode[byte4 - 0xa0]);
734  break;
735  case 0x0e:
736  // Korean
737  if (byte4 > 0xa0)
738  return QChar(koreanKeysymsToUnicode[byte4 - 0xa0]);
739  break;
740  default:
741  break;
742  }
743  return QChar(0x0);
744 }
745 
746 Qt::KeyboardModifiers QXcbKeyboard::translateModifiers(int s)
747 {
748  Qt::KeyboardModifiers ret = 0;
749  if (s & XCB_MOD_MASK_SHIFT)
750  ret |= Qt::ShiftModifier;
751  if (s & XCB_MOD_MASK_CONTROL)
752  ret |= Qt::ControlModifier;
753  if (s & m_alt_mask)
754  ret |= Qt::AltModifier;
755  if (s & m_meta_mask)
756  ret |= Qt::MetaModifier;
757  return ret;
758 }
759 
761 {
762  int code = -1;
763  int i = 0; // any other keys
764  while (KeyTbl[i]) {
765  if (key == KeyTbl[i]) {
766  code = (int)KeyTbl[i+1];
767  break;
768  }
769  i += 2;
770  }
771  if (m_meta_mask) {
772  // translate Super/Hyper keys to Meta if we're using them as the MetaModifier
773  if (m_meta_mask == m_super_mask && (code == Qt::Key_Super_L || code == Qt::Key_Super_R)) {
774  code = Qt::Key_Meta;
775  } else if (m_meta_mask == m_hyper_mask && (code == Qt::Key_Hyper_L || code == Qt::Key_Hyper_R)) {
776  code = Qt::Key_Meta;
777  }
778  }
779  return code;
780 }
781 
783  int &code, Qt::KeyboardModifiers &modifiers,
784  QByteArray &chars, int &count)
785 {
786  // all keysyms smaller than 0xff00 are actally keys that can be mapped to unicode chars
787 
789  QChar converted;
790 
791  if (/*count == 0 &&*/ keysym < 0xff00) {
792  unsigned char byte3 = (unsigned char)(keysym >> 8);
793  int mib = -1;
794  switch(byte3) {
795  case 0: // Latin 1
796  case 1: // Latin 2
797  case 2: //latin 3
798  case 3: // latin4
799  mib = byte3 + 4; break;
800  case 5: // arabic
801  mib = 82; break;
802  case 12: // Hebrew
803  mib = 85; break;
804  case 13: // Thai
805  mib = 2259; break;
806  case 4: // kana
807  case 6: // cyrillic
808  case 7: // greek
809  case 8: // technical, no mapping here at the moment
810  case 9: // Special
811  case 10: // Publishing
812  case 11: // APL
813  case 14: // Korean, no mapping
814  mib = -1; // manual conversion
815  mapper= 0;
816 #if !defined(QT_NO_XIM)
817  converted = keysymToUnicode(byte3, keysym & 0xff);
818 #endif
819  case 0x20:
820  // currency symbols
821  if (keysym >= 0x20a0 && keysym <= 0x20ac) {
822  mib = -1; // manual conversion
823  mapper = 0;
824  converted = (uint)keysym;
825  }
826  break;
827  default:
828  break;
829  }
830  if (mib != -1) {
831  mapper = QTextCodec::codecForMib(mib);
832  if (chars.isEmpty())
833  chars.resize(1);
834  chars[0] = (unsigned char) (keysym & 0xff); // get only the fourth bit for conversion later
835  count = 1;
836  }
837  } else if (keysym >= 0x1000000 && keysym <= 0x100ffff) {
838  converted = (ushort) (keysym - 0x1000000);
839  mapper = 0;
840  }
841  if (count < (int)chars.size()-1)
842  chars[count] = '\0';
843 
844  QString text;
845  if (!mapper && converted.unicode() != 0x0) {
846  text = converted;
847  } else if (!chars.isEmpty()) {
848  // convert chars (8bit) to text (unicode).
849  if (mapper)
850  text = mapper->toUnicode(chars.data(), count, 0);
851  if (text.isEmpty()) {
852  // no mapper, or codec couldn't convert to unicode (this
853  // can happen when running in the C locale or with no LANG
854  // set). try converting from latin-1
855  text = QString::fromLatin1(chars);
856  }
857  }
858 
859  modifiers = translateModifiers(xmodifiers);
860 
861  // Commentary in X11/keysymdef says that X codes match ASCII, so it
862  // is safe to use the locale functions to process X codes in ISO8859-1.
863  //
864  // This is mainly for compatibility - applications should not use the
865  // Qt keycodes between 128 and 255, but should rather use the
866  // QKeyEvent::text().
867  //
868  if (keysym < 128 || (keysym < 256 && (!mapper || mapper->mibEnum()==4))) {
869  // upper-case key, if known
870  code = isprint((int)keysym) ? toupper((int)keysym) : 0;
871  } else if (keysym >= XK_F1 && keysym <= XK_F35) {
872  // function keys
873  code = Qt::Key_F1 + ((int)keysym - XK_F1);
874  } else if (keysym >= XK_KP_Space && keysym <= XK_KP_9) {
875  if (keysym >= XK_KP_0) {
876  // numeric keypad keys
877  code = Qt::Key_0 + ((int)keysym - XK_KP_0);
878  } else {
879  code = translateKeySym(keysym);
880  }
881  modifiers |= Qt::KeypadModifier;
882  } else if (text.length() == 1 && text.unicode()->unicode() > 0x1f && text.unicode()->unicode() != 0x7f && !(keysym >= XK_dead_grave && keysym <= XK_dead_horn)) {
883  code = text.unicode()->toUpper().unicode();
884  } else {
885  // any other keys
886  code = translateKeySym(keysym);
887 
888  if (code == Qt::Key_Tab && (modifiers & Qt::ShiftModifier)) {
889  // map shift+tab to shift+backtab, QShortcutMap knows about it
890  // and will handle it.
891  code = Qt::Key_Backtab;
892  text = QString();
893  }
894  }
895 
896  return text;
897 }
898 
900  : QXcbObject(connection)
901  , m_alt_mask(0)
902  , m_super_mask(0)
903  , m_hyper_mask(0)
904  , m_meta_mask(0)
905 {
906  m_key_symbols = xcb_key_symbols_alloc(xcb_connection());
907 }
908 
910 {
911  xcb_key_symbols_free(m_key_symbols);
912 }
913 
914 // #define XCB_KEYBOARD_DEBUG
915 
916 void QXcbKeyboard::handleKeyEvent(QWidget *widget, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time)
917 {
918  int col = state & XCB_MOD_MASK_SHIFT ? 1 : 0;
919 
920  const int altGrOffset = 4;
921  if (state & 128)
922  col += altGrOffset;
923 
925 
926 #ifdef XCB_KEYBOARD_DEBUG
927  printf("key code: %d, state: %d, syms: ", code, state);
928  for (int i = 0; i <= 5; ++i) {
929  printf("%d ", xcb_key_symbols_get_keysym(m_key_symbols, code, i));
930  }
931  printf("\n");
932 #endif
933 
935 
936  xcb_keysym_t sym = xcb_key_symbols_get_keysym(m_key_symbols, code, col);
937  if (sym == XCB_NO_SYMBOL)
938  sym = xcb_key_symbols_get_keysym(m_key_symbols, code, col ^ 0x1);
939 
940  if (state & XCB_MOD_MASK_LOCK && sym <= 0x7f && isprint(sym)) {
941  if (isupper(sym))
942  sym = tolower(sym);
943  else
944  sym = toupper(sym);
945  }
946 
948 
949  QByteArray chars;
950 
951  Qt::KeyboardModifiers modifiers;
952  int qtcode = 0;
953  int count = 0;
954 
955  QString string = translateKeySym(sym, state, qtcode, modifiers, chars, count);
956 
957  QWindowSystemInterface::handleExtendedKeyEvent(widget, time, type, qtcode, modifiers, code, 0, state, string.left(count));
958 }
959 
960 void QXcbKeyboard::handleKeyPressEvent(QWidget *widget, const xcb_key_press_event_t *event)
961 {
962  handleKeyEvent(widget, QEvent::KeyPress, event->detail, event->state, event->time);
963 }
964 
965 void QXcbKeyboard::handleKeyReleaseEvent(QWidget *widget, const xcb_key_release_event_t *event)
966 {
967  handleKeyEvent(widget, QEvent::KeyRelease, event->detail, event->state, event->time);
968 }
969 
970 void QXcbKeyboard::handleMappingNotifyEvent(const xcb_mapping_notify_event_t *event)
971 {
972  xcb_refresh_keyboard_mapping(m_key_symbols, const_cast<xcb_mapping_notify_event_t *>(event));
973 }
static QTextCodec * codecForLocale()
Returns a pointer to the codec most suitable for this locale.
#define XF86XK_MailForward
#define XF86XK_ClearGrab
#define XF86XK_KbdBrightnessDown
#define XF86XK_Launch2
#define XF86XK_Video
#define XF86XK_AudioMedia
#define XF86XK_Spell
#define XF86XK_Eject
#define XF86XK_TopMenu
#define XF86XK_Pictures
#define XF86XK_Launch9
#define XF86XK_Launch8
#define XF86XK_Reply
#define XF86XK_CD
#define XF86XK_KbdLightOnOff
#define XF86XK_ScreenSaver
#define XF86XK_Save
#define XF86XK_Memo
#define XF86XK_Paste
static const unsigned short katakanaKeysymsToUnicode[]
int type
Definition: qmetatype.cpp:239
#define XF86XK_Clear
#define XF86XK_Phone
#define XF86XK_History
#define XF86XK_Mail
#define XF86XK_OfficeHome
#define XK_KP_Insert
EventRef event
QPointer< QWidget > widget
#define XF86XK_AudioPrev
#define XF86XK_Search
#define QTOPIAXK_Context1
char * data()
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:429
#define XK_KP_Home
#define XF86XK_TaskPane
#define QTOPIAXK_Select
#define XF86XK_MyComputer
ushort unicode() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qchar.h:251
#define XF86XK_MenuPB
#define XF86XK_Refresh
#define XF86XK_WLAN
#define XK_KP_Left
#define XK_ISO_Left_Tab
#define XF86XK_LaunchA
#define XF86XK_LaunchB
#define XF86XK_RotateWindows
#define XF86XK_Launch6
xcb_key_symbols_t * m_key_symbols
Definition: qxcbkeyboard.h:79
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
#define XF86XK_Favorites
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
#define XF86XK_ZoomOut
xcb_connection_t * xcb_connection() const
Definition: qxcbobject.h:56
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
#define QTOPIAXK_Context4
void handleMappingNotifyEvent(const xcb_mapping_notify_event_t *event)
#define XF86XK_ApplicationLeft
#define XF86XK_Finance
#define XK_KP_Right
void handleKeyReleaseEvent(QWidget *widget, const xcb_key_release_event_t *event)
#define XF86XK_WakeUp
#define XF86XK_Word
static const unsigned short koreanKeysymsToUnicode[]
#define XF86XK_MySites
#define XF86XK_Calculator
#define XF86XK_MonBrightnessUp
#define XF86XK_AudioRepeat
int keysym
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define XF86XK_Bluetooth
#define XF86XK_BackForward
#define XK_KP_End
#define XF86XK_SplitScreen
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
#define XF86XK_Book
#define XK_KP_Down
#define XF86XK_Messenger
static const unsigned short cyrillicKeysymsToUnicode[]
#define XF86XK_Launch5
#define XF86XK_AudioRecord
QXcbConnection * connection() const
Definition: qxcbobject.h:53
#define XF86XK_Calendar
#define XK_KP_Up
#define XF86XK_Suspend
#define XK_KP_Next
#define QTOPIAXK_Yes
#define XF86XK_Forward
#define XF86XK_Meeting
#define XF86XK_LightBulb
#define XF86XK_KbdBrightnessUp
#define XF86XK_MonBrightnessDown
static const unsigned short aplKeysymsToUnicode[]
#define XF86XK_Launch0
const QChar * unicode() const
Returns a &#39;\0&#39;-terminated Unicode representation of the string.
Definition: qstring.h:706
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
static const unsigned short publishingKeysymsToUnicode[]
#define XF86XK_ContrastAdjust
#define XF86XK_Stop
QXcbKeyboard(QXcbConnection *connection)
#define XF86XK_Community
#define XF86XK_Documents
static const unsigned int KeyTbl[]
#define XF86XK_Sleep
#define XK_Codeinput
#define XF86XK_UWB
#define XF86XK_WWW
unsigned short quint16
Definition: qglobal.h:936
#define XF86XK_PowerDown
#define XF86XK_Shop
uint m_hyper_mask
Definition: qxcbkeyboard.h:74
#define XF86XK_LogOff
virtual int mibEnum() const =0
Subclasses of QTextCodec must reimplement this function.
unsigned int uint
Definition: qglobal.h:996
int mib
#define XF86XK_AudioForward
#define XF86XK_Display
QChar toUpper() const
Returns the uppercase equivalent if the character is lowercase or titlecase; otherwise returns the ch...
Definition: qchar.cpp:1287
#define XF86XK_Away
#define QTOPIAXK_Call
static QTextCodec * codecForMib(int mib)
Returns the QTextCodec which matches the MIBenum mib.
#define QTOPIAXK_Hangup
#define XF86XK_Explorer
static void handleExtendedKeyEvent(QWidget *w, QEvent::Type type, int key, Qt::KeyboardModifiers modifiers, quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers, const QString &text=QString(), bool autorep=false, ushort count=1)
static const unsigned short technicalKeysymsToUnicode[]
#define XF86XK_Back
#define XF86XK_Send
#define QTOPIAXK_Play
#define XF86XK_Game
#define XK_Kanji_Bangou
#define XF86XK_ApplicationRight
#define XK_dead_hook
#define XF86XK_AudioRandomPlay
#define XF86XK_Support
#define XF86XK_LaunchF
#define XK_dead_horn
#define QTOPIAXK_Execute
QString toUnicode(const QByteArray &) const
Converts a from the encoding of this codec to Unicode, and returns the result in a QString...
#define XF86XK_RotationPB
#define XF86XK_Travel
#define XF86XK_Tools
#define QTOPIAXK_Context3
#define XF86XK_AudioCycleTrack
#define QTOPIAXK_Context2
#define XF86XK_Cut
uint m_meta_mask
Definition: qxcbkeyboard.h:75
#define XF86XK_Music
#define XF86XK_View
#define XF86XK_AudioMute
#define XF86XK_Excel
Type
This enum type defines the valid event types in Qt.
Definition: qcoreevent.h:62
#define QTOPIAXK_Printer
#define XF86XK_AddFavorite
static QChar keysymToUnicode(unsigned char byte3, unsigned char byte4)
#define XF86XK_DOS
unsigned short ushort
Definition: qglobal.h:995
#define XF86XK_AudioRaiseVolume
#define XF86XK_Launch3
#define XF86XK_Go
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
#define XF86XK_Launch7
#define XF86XK_Battery
#define XF86XK_Option
int key
#define XF86XK_Launch4
void resize(int size)
Sets the size of the byte array to size bytes.
#define QTOPIAXK_Zoom
static const unsigned short greekKeysymsToUnicode[]
#define Q_XCB_NOOP(c)
#define XF86XK_LaunchC
#define XF86XK_LaunchE
#define XF86XK_Terminal
int size() const
Returns the number of bytes in this byte array.
Definition: qbytearray.h:402
Qt::KeyboardModifiers translateModifiers(int s)
#define XF86XK_News
#define XF86XK_AudioRewind
#define QTOPIAXK_Sleep
#define XF86XK_Market
#define XK_KP_Delete
#define XF86XK_WebCam
#define XF86XK_iTouch
#define QTOPIAXK_Cancel
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
Definition: qbytearray.h:421
#define XF86XK_Close
#define XF86XK_AudioStop
#define XF86XK_RotationKB
#define XF86XK_ToDoList
#define XF86XK_Reload
#define XF86XK_Copy
#define XF86XK_AudioLowerVolume
#define XF86XK_Launch1
#define XF86XK_OpenURL
#define XF86XK_Calculater
#define XK_KP_Prior
The QTextCodec class provides conversions between text encodings.
Definition: qtextcodec.h:62
#define XF86XK_Time
void handleKeyEvent(QWidget *widget, QEvent::Type type, xcb_keycode_t code, quint16 state, xcb_timestamp_t time)
#define XF86XK_Hibernate
#define QTOPIAXK_No
int translateKeySym(uint key) const
#define XF86XK_Select
#define QTOPIAXK_Flip
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
#define XF86XK_MenuKB
#define XF86XK_Standby
#define XF86XK_Xfer
#define XF86XK_AudioPlay
uint m_super_mask
Definition: qxcbkeyboard.h:73
void handleKeyPressEvent(QWidget *widget, const xcb_key_press_event_t *event)
#define XF86XK_Subtitle
#define XF86XK_LaunchD
static const unsigned short specialKeysymsToUnicode[]
#define XF86XK_ZoomIn
#define text
Definition: qobjectdefs.h:80
#define XF86XK_AudioNext
#define XF86XK_PowerOff
#define XF86XK_BrightnessAdjust
#define XF86XK_HotLinks
#define XF86XK_HomePage