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