• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdelibs-4.14.38 API Reference
  • KDE Home
  • Contact Us
 

KDEUI

  • kdeui
  • util
kkeyserver_x11.cpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2001 Ellis Whitehead <ellis@kde.org>
3
4 Win32 port:
5 Copyright (C) 2004 Jarosław Staniek <staniek@kde.org>
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
11
12 This library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
16
17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 Boston, MA 02110-1301, USA.
21*/
22
23#include "kkeyserver_x11.h"
24
25#include "kdebug.h"
26#include "klocale.h"
27
28#include <QX11Info>
29# define XK_MISCELLANY
30# define XK_XKB_KEYS
31# include <X11/X.h>
32# include <X11/Xlib.h>
33# include <X11/Xutil.h>
34# include <X11/keysymdef.h>
35# define X11_ONLY(arg) arg, //allows to omit an argument
36
37// #define KKEYSERVER_DEBUG 1
38
39
40
41namespace KKeyServer
42{
43
44//---------------------------------------------------------------------
45// Data Structures
46//---------------------------------------------------------------------
47
48struct Mod
49{
50 int m_mod;
51};
52
53//---------------------------------------------------------------------
54// Array Structures
55//---------------------------------------------------------------------
56
57struct X11ModInfo
58{
59 int modQt;
60 int modX;
61};
62
63struct SymVariation
64{
65 uint sym, symVariation;
66 bool bActive;
67};
68
69struct SymName
70{
71 uint sym;
72 const char* psName;
73};
74
75struct TransKey {
76 int keySymQt;
77 uint keySymX;
78};
79
80//---------------------------------------------------------------------
81// Arrays
82//---------------------------------------------------------------------
83
84static X11ModInfo g_rgX11ModInfo[4] =
85{
86 { Qt::SHIFT, X11_ONLY(ShiftMask) },
87 { Qt::CTRL, X11_ONLY(ControlMask) },
88 { Qt::ALT, X11_ONLY(Mod1Mask) },
89 { Qt::META, X11_ONLY(Mod4Mask) }
90};
91
92// Special Names List
93static const SymName g_rgSymNames[] = {
94 { XK_ISO_Left_Tab, "Backtab" },
95 { XK_BackSpace, I18N_NOOP("Backspace") },
96 { XK_Sys_Req, I18N_NOOP("SysReq") },
97 { XK_Caps_Lock, I18N_NOOP("CapsLock") },
98 { XK_Num_Lock, I18N_NOOP("NumLock") },
99 { XK_Scroll_Lock, I18N_NOOP("ScrollLock") },
100 { XK_Prior, I18N_NOOP("PageUp") },
101 { XK_Next, I18N_NOOP("PageDown") },
102#ifdef sun
103 { XK_F11, I18N_NOOP("Stop") },
104 { XK_F12, I18N_NOOP("Again") },
105 { XK_F13, I18N_NOOP("Props") },
106 { XK_F14, I18N_NOOP("Undo") },
107 { XK_F15, I18N_NOOP("Front") },
108 { XK_F16, I18N_NOOP("Copy") },
109 { XK_F17, I18N_NOOP("Open") },
110 { XK_F18, I18N_NOOP("Paste") },
111 { XK_F19, I18N_NOOP("Find") },
112 { XK_F20, I18N_NOOP("Cut") },
113 { XK_F22, I18N_NOOP("Print") },
114#endif
115 { 0, 0 }
116};
117
118// These are the X equivalents to the Qt keycodes 0x1000 - 0x1026
119static const TransKey g_rgQtToSymX[] =
120{
121 { Qt::Key_Escape, XK_Escape },
122 { Qt::Key_Tab, XK_Tab },
123 { Qt::Key_Backtab, XK_ISO_Left_Tab },
124 { Qt::Key_Backspace, XK_BackSpace },
125 { Qt::Key_Return, XK_Return },
126 { Qt::Key_Enter, XK_KP_Enter },
127 { Qt::Key_Insert, XK_Insert },
128 { Qt::Key_Delete, XK_Delete },
129 { Qt::Key_Pause, XK_Pause },
130#ifdef sun
131 { Qt::Key_Print, XK_F22 },
132#else
133 { Qt::Key_Print, XK_Print },
134#endif
135 { Qt::Key_SysReq, XK_Sys_Req },
136 { Qt::Key_Home, XK_Home },
137 { Qt::Key_End, XK_End },
138 { Qt::Key_Left, XK_Left },
139 { Qt::Key_Up, XK_Up },
140 { Qt::Key_Right, XK_Right },
141 { Qt::Key_Down, XK_Down },
142 { Qt::Key_PageUp, XK_Prior },
143 { Qt::Key_PageDown, XK_Next },
144 //{ Qt::Key_Shift, 0 },
145 //{ Qt::Key_Control, 0 },
146 //{ Qt::Key_Meta, 0 },
147 //{ Qt::Key_Alt, 0 },
148 { Qt::Key_CapsLock, XK_Caps_Lock },
149 { Qt::Key_NumLock, XK_Num_Lock },
150 { Qt::Key_ScrollLock, XK_Scroll_Lock },
151 { Qt::Key_F1, XK_F1 },
152 { Qt::Key_F2, XK_F2 },
153 { Qt::Key_F3, XK_F3 },
154 { Qt::Key_F4, XK_F4 },
155 { Qt::Key_F5, XK_F5 },
156 { Qt::Key_F6, XK_F6 },
157 { Qt::Key_F7, XK_F7 },
158 { Qt::Key_F8, XK_F8 },
159 { Qt::Key_F9, XK_F9 },
160 { Qt::Key_F10, XK_F10 },
161 { Qt::Key_F11, XK_F11 },
162 { Qt::Key_F12, XK_F12 },
163 { Qt::Key_F13, XK_F13 },
164 { Qt::Key_F14, XK_F14 },
165 { Qt::Key_F15, XK_F15 },
166 { Qt::Key_F16, XK_F16 },
167 { Qt::Key_F17, XK_F17 },
168 { Qt::Key_F18, XK_F18 },
169 { Qt::Key_F19, XK_F19 },
170 { Qt::Key_F20, XK_F20 },
171 { Qt::Key_F21, XK_F21 },
172 { Qt::Key_F22, XK_F22 },
173 { Qt::Key_F23, XK_F23 },
174 { Qt::Key_F24, XK_F24 },
175 { Qt::Key_F25, XK_F25 },
176 { Qt::Key_F26, XK_F26 },
177 { Qt::Key_F27, XK_F27 },
178 { Qt::Key_F28, XK_F28 },
179 { Qt::Key_F29, XK_F29 },
180 { Qt::Key_F30, XK_F30 },
181 { Qt::Key_F31, XK_F31 },
182 { Qt::Key_F32, XK_F32 },
183 { Qt::Key_F33, XK_F33 },
184 { Qt::Key_F34, XK_F34 },
185 { Qt::Key_F35, XK_F35 },
186 { Qt::Key_Super_L, XK_Super_L },
187 { Qt::Key_Super_R, XK_Super_R },
188 { Qt::Key_Menu, XK_Menu },
189 { Qt::Key_Hyper_L, XK_Hyper_L },
190 { Qt::Key_Hyper_R, XK_Hyper_R },
191 { Qt::Key_Help, XK_Help },
192 //{ Qt::Key_Direction_L, XK_Direction_L }, These keys don't exist in X11
193 //{ Qt::Key_Direction_R, XK_Direction_R },
194
195 { '/', XK_KP_Divide },
196 { '*', XK_KP_Multiply },
197 { '-', XK_KP_Subtract },
198 { '+', XK_KP_Add },
199 { Qt::Key_Return, XK_KP_Enter }
200
201// the next lines are taken on 10/2009 from X.org (X11/XF86keysym.h), defining some special
202// multimedia keys. They are included here as not every system has them.
203#define XF86XK_MonBrightnessUp 0x1008FF02
204#define XF86XK_MonBrightnessDown 0x1008FF03
205#define XF86XK_KbdLightOnOff 0x1008FF04
206#define XF86XK_KbdBrightnessUp 0x1008FF05
207#define XF86XK_KbdBrightnessDown 0x1008FF06
208#define XF86XK_Standby 0x1008FF10
209#define XF86XK_AudioLowerVolume 0x1008FF11
210#define XF86XK_AudioMute 0x1008FF12
211#define XF86XK_AudioRaiseVolume 0x1008FF13
212#define XF86XK_AudioPlay 0x1008FF14
213#define XF86XK_AudioStop 0x1008FF15
214#define XF86XK_AudioPrev 0x1008FF16
215#define XF86XK_AudioNext 0x1008FF17
216#define XF86XK_HomePage 0x1008FF18
217#define XF86XK_Mail 0x1008FF19
218#define XF86XK_Start 0x1008FF1A
219#define XF86XK_Search 0x1008FF1B
220#define XF86XK_AudioRecord 0x1008FF1C
221#define XF86XK_Calculator 0x1008FF1D
222#define XF86XK_Memo 0x1008FF1E
223#define XF86XK_ToDoList 0x1008FF1F
224#define XF86XK_Calendar 0x1008FF20
225#define XF86XK_PowerDown 0x1008FF21
226#define XF86XK_ContrastAdjust 0x1008FF22
227#define XF86XK_Back 0x1008FF26
228#define XF86XK_Forward 0x1008FF27
229#define XF86XK_Stop 0x1008FF28
230#define XF86XK_Refresh 0x1008FF29
231#define XF86XK_PowerOff 0x1008FF2A
232#define XF86XK_WakeUp 0x1008FF2B
233#define XF86XK_Eject 0x1008FF2C
234#define XF86XK_ScreenSaver 0x1008FF2D
235#define XF86XK_WWW 0x1008FF2E
236#define XF86XK_Sleep 0x1008FF2F
237#define XF86XK_Favorites 0x1008FF30
238#define XF86XK_AudioPause 0x1008FF31
239#define XF86XK_AudioMedia 0x1008FF32
240#define XF86XK_MyComputer 0x1008FF33
241#define XF86XK_LightBulb 0x1008FF35
242#define XF86XK_Shop 0x1008FF36
243#define XF86XK_History 0x1008FF37
244#define XF86XK_OpenURL 0x1008FF38
245#define XF86XK_AddFavorite 0x1008FF39
246#define XF86XK_HotLinks 0x1008FF3A
247#define XF86XK_BrightnessAdjust 0x1008FF3B
248#define XF86XK_Finance 0x1008FF3C
249#define XF86XK_Community 0x1008FF3D
250#define XF86XK_AudioRewind 0x1008FF3E
251#define XF86XK_BackForward 0x1008FF3F
252#define XF86XK_Launch0 0x1008FF40
253#define XF86XK_Launch1 0x1008FF41
254#define XF86XK_Launch2 0x1008FF42
255#define XF86XK_Launch3 0x1008FF43
256#define XF86XK_Launch4 0x1008FF44
257#define XF86XK_Launch5 0x1008FF45
258#define XF86XK_Launch6 0x1008FF46
259#define XF86XK_Launch7 0x1008FF47
260#define XF86XK_Launch8 0x1008FF48
261#define XF86XK_Launch9 0x1008FF49
262#define XF86XK_LaunchA 0x1008FF4A
263#define XF86XK_LaunchB 0x1008FF4B
264#define XF86XK_LaunchC 0x1008FF4C
265#define XF86XK_LaunchD 0x1008FF4D
266#define XF86XK_LaunchE 0x1008FF4E
267#define XF86XK_LaunchF 0x1008FF4F
268#define XF86XK_ApplicationLeft 0x1008FF50
269#define XF86XK_ApplicationRight 0x1008FF51
270#define XF86XK_Book 0x1008FF52
271#define XF86XK_CD 0x1008FF53
272#define XF86XK_Calculater 0x1008FF54
273#define XF86XK_Clear 0x1008FF55
274#define XF86XK_ClearGrab 0x1008FE21
275#define XF86XK_Close 0x1008FF56
276#define XF86XK_Copy 0x1008FF57
277#define XF86XK_Cut 0x1008FF58
278#define XF86XK_Display 0x1008FF59
279#define XF86XK_DOS 0x1008FF5A
280#define XF86XK_Documents 0x1008FF5B
281#define XF86XK_Excel 0x1008FF5C
282#define XF86XK_Explorer 0x1008FF5D
283#define XF86XK_Game 0x1008FF5E
284#define XF86XK_Go 0x1008FF5F
285#define XF86XK_iTouch 0x1008FF60
286#define XF86XK_LogOff 0x1008FF61
287#define XF86XK_Market 0x1008FF62
288#define XF86XK_Meeting 0x1008FF63
289#define XF86XK_MenuKB 0x1008FF65
290#define XF86XK_MenuPB 0x1008FF66
291#define XF86XK_MySites 0x1008FF67
292#define XF86XK_News 0x1008FF69
293#define XF86XK_OfficeHome 0x1008FF6A
294#define XF86XK_Option 0x1008FF6C
295#define XF86XK_Paste 0x1008FF6D
296#define XF86XK_Phone 0x1008FF6E
297#define XF86XK_Reply 0x1008FF72
298#define XF86XK_Reload 0x1008FF73
299#define XF86XK_RotateWindows 0x1008FF74
300#define XF86XK_RotationPB 0x1008FF75
301#define XF86XK_RotationKB 0x1008FF76
302#define XF86XK_Save 0x1008FF77
303#define XF86XK_Send 0x1008FF7B
304#define XF86XK_Spell 0x1008FF7C
305#define XF86XK_SplitScreen 0x1008FF7D
306#define XF86XK_Support 0x1008FF7E
307#define XF86XK_TaskPane 0x1008FF7F
308#define XF86XK_Terminal 0x1008FF80
309#define XF86XK_Tools 0x1008FF81
310#define XF86XK_Travel 0x1008FF82
311#define XF86XK_Video 0x1008FF87
312#define XF86XK_Word 0x1008FF89
313#define XF86XK_Xfer 0x1008FF8A
314#define XF86XK_ZoomIn 0x1008FF8B
315#define XF86XK_ZoomOut 0x1008FF8C
316#define XF86XK_Away 0x1008FF8D
317#define XF86XK_Messenger 0x1008FF8E
318#define XF86XK_WebCam 0x1008FF8F
319#define XF86XK_MailForward 0x1008FF90
320#define XF86XK_Pictures 0x1008FF91
321#define XF86XK_Music 0x1008FF92
322#define XF86XK_Battery 0x1008FF93
323#define XF86XK_Bluetooth 0x1008FF94
324#define XF86XK_WLAN 0x1008FF95
325#define XF86XK_UWB 0x1008FF96
326#define XF86XK_AudioForward 0x1008FF97
327#define XF86XK_AudioRepeat 0x1008FF98
328#define XF86XK_AudioRandomPlay 0x1008FF99
329#define XF86XK_Subtitle 0x1008FF9A
330#define XF86XK_AudioCycleTrack 0x1008FF9B
331#define XF86XK_Time 0x1008FF9F
332#define XF86XK_Select 0x1008FFA0
333#define XF86XK_View 0x1008FFA1
334#define XF86XK_TopMenu 0x1008FFA2
335#define XF86XK_Suspend 0x1008FFA7
336#define XF86XK_Hibernate 0x1008FFA8
337// end of XF86keysyms.h
338 ,
339
340 // All of the stuff below really has to match qkeymapper_x11.cpp in Qt!
341 { Qt::Key_Back, XF86XK_Back },
342 { Qt::Key_Forward, XF86XK_Forward },
343 { Qt::Key_Stop, XF86XK_Stop },
344 { Qt::Key_Refresh, XF86XK_Refresh },
345 { Qt::Key_Favorites, XF86XK_Favorites },
346 { Qt::Key_LaunchMedia, XF86XK_AudioMedia },
347 { Qt::Key_OpenUrl, XF86XK_OpenURL },
348 { Qt::Key_HomePage, XF86XK_HomePage },
349 { Qt::Key_Search, XF86XK_Search },
350 { Qt::Key_VolumeDown, XF86XK_AudioLowerVolume },
351 { Qt::Key_VolumeMute, XF86XK_AudioMute },
352 { Qt::Key_VolumeUp, XF86XK_AudioRaiseVolume },
353 { Qt::Key_MediaPlay, XF86XK_AudioPlay },
354 { Qt::Key_MediaStop, XF86XK_AudioStop },
355 { Qt::Key_MediaPrevious, XF86XK_AudioPrev },
356 { Qt::Key_MediaNext, XF86XK_AudioNext },
357 { Qt::Key_MediaRecord, XF86XK_AudioRecord },
358 { Qt::Key_LaunchMail, XF86XK_Mail },
359 { Qt::Key_Launch0, XF86XK_MyComputer },
360 { Qt::Key_Launch1, XF86XK_Calculator },
361 { Qt::Key_Memo, XF86XK_Memo },
362 { Qt::Key_ToDoList, XF86XK_ToDoList },
363 { Qt::Key_Calendar, XF86XK_Calendar },
364 { Qt::Key_PowerDown, XF86XK_PowerDown },
365 { Qt::Key_ContrastAdjust, XF86XK_ContrastAdjust },
366 { Qt::Key_Standby, XF86XK_Standby },
367 { Qt::Key_MonBrightnessUp, XF86XK_MonBrightnessUp },
368 { Qt::Key_MonBrightnessDown, XF86XK_MonBrightnessDown },
369 { Qt::Key_KeyboardLightOnOff, XF86XK_KbdLightOnOff },
370 { Qt::Key_KeyboardBrightnessUp, XF86XK_KbdBrightnessUp },
371 { Qt::Key_KeyboardBrightnessDown, XF86XK_KbdBrightnessDown },
372 { Qt::Key_PowerOff, XF86XK_PowerOff },
373 { Qt::Key_WakeUp, XF86XK_WakeUp },
374 { Qt::Key_Eject, XF86XK_Eject },
375 { Qt::Key_ScreenSaver, XF86XK_ScreenSaver },
376 { Qt::Key_WWW, XF86XK_WWW },
377 { Qt::Key_Sleep, XF86XK_Sleep },
378 { Qt::Key_LightBulb, XF86XK_LightBulb },
379 { Qt::Key_Shop, XF86XK_Shop },
380 { Qt::Key_History, XF86XK_History },
381 { Qt::Key_AddFavorite, XF86XK_AddFavorite },
382 { Qt::Key_HotLinks, XF86XK_HotLinks },
383 { Qt::Key_BrightnessAdjust, XF86XK_BrightnessAdjust },
384 { Qt::Key_Finance, XF86XK_Finance },
385 { Qt::Key_Community, XF86XK_Community },
386 { Qt::Key_AudioRewind, XF86XK_AudioRewind },
387 { Qt::Key_BackForward, XF86XK_BackForward },
388 { Qt::Key_ApplicationLeft, XF86XK_ApplicationLeft },
389 { Qt::Key_ApplicationRight, XF86XK_ApplicationRight },
390 { Qt::Key_Book, XF86XK_Book },
391 { Qt::Key_CD, XF86XK_CD },
392 { Qt::Key_Calculator, XF86XK_Calculater },
393 { Qt::Key_Clear, XF86XK_Clear },
394 { Qt::Key_ClearGrab, XF86XK_ClearGrab },
395 { Qt::Key_Close, XF86XK_Close },
396 { Qt::Key_Copy, XF86XK_Copy },
397 { Qt::Key_Cut, XF86XK_Cut },
398 { Qt::Key_Display, XF86XK_Display },
399 { Qt::Key_DOS, XF86XK_DOS },
400 { Qt::Key_Documents, XF86XK_Documents },
401 { Qt::Key_Excel, XF86XK_Excel },
402 { Qt::Key_Explorer, XF86XK_Explorer },
403 { Qt::Key_Game, XF86XK_Game },
404 { Qt::Key_Go, XF86XK_Go },
405 { Qt::Key_iTouch, XF86XK_iTouch },
406 { Qt::Key_LogOff, XF86XK_LogOff },
407 { Qt::Key_Market, XF86XK_Market },
408 { Qt::Key_Meeting, XF86XK_Meeting },
409 { Qt::Key_MenuKB, XF86XK_MenuKB },
410 { Qt::Key_MenuPB, XF86XK_MenuPB },
411 { Qt::Key_MySites, XF86XK_MySites },
412 { Qt::Key_News, XF86XK_News },
413 { Qt::Key_OfficeHome, XF86XK_OfficeHome },
414 { Qt::Key_Option, XF86XK_Option },
415 { Qt::Key_Paste, XF86XK_Paste },
416 { Qt::Key_Phone, XF86XK_Phone },
417 { Qt::Key_Reply, XF86XK_Reply },
418 { Qt::Key_Reload, XF86XK_Reload },
419 { Qt::Key_RotateWindows, XF86XK_RotateWindows },
420 { Qt::Key_RotationPB, XF86XK_RotationPB },
421 { Qt::Key_RotationKB, XF86XK_RotationKB },
422 { Qt::Key_Save, XF86XK_Save },
423 { Qt::Key_Send, XF86XK_Send },
424 { Qt::Key_Spell, XF86XK_Spell },
425 { Qt::Key_SplitScreen, XF86XK_SplitScreen },
426 { Qt::Key_Support, XF86XK_Support },
427 { Qt::Key_TaskPane, XF86XK_TaskPane },
428 { Qt::Key_Terminal, XF86XK_Terminal },
429 { Qt::Key_Tools, XF86XK_Tools },
430 { Qt::Key_Travel, XF86XK_Travel },
431 { Qt::Key_Video, XF86XK_Video },
432 { Qt::Key_Word, XF86XK_Word },
433 { Qt::Key_Xfer, XF86XK_Xfer },
434 { Qt::Key_ZoomIn, XF86XK_ZoomIn },
435 { Qt::Key_ZoomOut, XF86XK_ZoomOut },
436 { Qt::Key_Away, XF86XK_Away },
437 { Qt::Key_Messenger, XF86XK_Messenger },
438 { Qt::Key_WebCam, XF86XK_WebCam },
439 { Qt::Key_MailForward, XF86XK_MailForward },
440 { Qt::Key_Pictures, XF86XK_Pictures },
441 { Qt::Key_Music, XF86XK_Music },
442 { Qt::Key_Battery, XF86XK_Battery },
443 { Qt::Key_Bluetooth, XF86XK_Bluetooth },
444 { Qt::Key_WLAN, XF86XK_WLAN },
445 { Qt::Key_UWB, XF86XK_UWB },
446 { Qt::Key_AudioForward, XF86XK_AudioForward },
447 { Qt::Key_AudioRepeat, XF86XK_AudioRepeat },
448 { Qt::Key_AudioRandomPlay, XF86XK_AudioRandomPlay },
449 { Qt::Key_Subtitle, XF86XK_Subtitle },
450 { Qt::Key_AudioCycleTrack, XF86XK_AudioCycleTrack },
451 { Qt::Key_Time, XF86XK_Time },
452 { Qt::Key_Select, XF86XK_Select },
453 { Qt::Key_View, XF86XK_View },
454 { Qt::Key_TopMenu, XF86XK_TopMenu },
455 { Qt::Key_Bluetooth, XF86XK_Bluetooth },
456 { Qt::Key_Suspend, XF86XK_Suspend },
457 { Qt::Key_Hibernate, XF86XK_Hibernate },
458 { Qt::Key_Launch2, XF86XK_Launch0 },
459 { Qt::Key_Launch3, XF86XK_Launch1 },
460 { Qt::Key_Launch4, XF86XK_Launch2 },
461 { Qt::Key_Launch5, XF86XK_Launch3 },
462 { Qt::Key_Launch6, XF86XK_Launch4 },
463 { Qt::Key_Launch7, XF86XK_Launch5 },
464 { Qt::Key_Launch8, XF86XK_Launch6 },
465 { Qt::Key_Launch9, XF86XK_Launch7 },
466 { Qt::Key_LaunchA, XF86XK_Launch8 },
467 { Qt::Key_LaunchB, XF86XK_Launch9 },
468 { Qt::Key_LaunchC, XF86XK_LaunchA },
469 { Qt::Key_LaunchD, XF86XK_LaunchB },
470 { Qt::Key_LaunchE, XF86XK_LaunchC },
471 { Qt::Key_LaunchF, XF86XK_LaunchD },
472};
473
474//---------------------------------------------------------------------
475// Debugging
476//---------------------------------------------------------------------
477#ifndef NDEBUG
478inline void checkDisplay()
479{
480 // Some non-GUI apps might try to use us.
481 if ( !QX11Info::display() ) {
482 kError() << "QX11Info::display() returns 0. I'm probably going to crash now." << endl;
483 kError() << "If this is a KApplication initialized without GUI stuff, change it to be "
484 "initialized with GUI stuff." << endl;
485 }
486}
487#else // NDEBUG
488# define checkDisplay()
489#endif
490
491//---------------------------------------------------------------------
492// Initialization
493//---------------------------------------------------------------------
494
495static bool g_bInitializedMods;
496static uint g_modXNumLock, g_modXScrollLock, g_modXModeSwitch, g_alt_mask, g_meta_mask, g_super_mask, g_hyper_mask;
497
498bool initializeMods()
499{
500 // Reinitialize the masks
501 g_modXNumLock = 0;
502 g_modXScrollLock = 0;
503 g_modXModeSwitch = 0;
504 g_alt_mask = 0;
505 g_meta_mask = 0;
506 g_super_mask = 0;
507 g_hyper_mask = 0;
508
509 checkDisplay();
510 XModifierKeymap* xmk = XGetModifierMapping( QX11Info::display() );
511
512 int min_keycode, max_keycode;
513 int keysyms_per_keycode = 0;
514
515 XDisplayKeycodes( QX11Info::display(), &min_keycode, &max_keycode );
516 XFree( XGetKeyboardMapping( QX11Info::display(), min_keycode, 1, &keysyms_per_keycode ));
517
518 for( int i = Mod1MapIndex; i < 8; i++ ) {
519 uint mask = (1 << i);
520 uint keySymX = NoSymbol;
521
522 // This used to be only XKeycodeToKeysym( ... , 0 ), but that fails with XFree4.3.99
523 // and X.org R6.7 , where for some reason only ( ... , 1 ) works. I have absolutely no
524 // idea what the problem is, but searching all possibilities until something valid is
525 // found fixes the problem.
526 for( int j = 0; j < xmk->max_keypermod; ++j ) {
527
528 for( int k = 0; k < keysyms_per_keycode; ++k ) {
529
530 keySymX = XKeycodeToKeysym( QX11Info::display(), xmk->modifiermap[xmk->max_keypermod * i + j], k );
531
532 switch( keySymX ) {
533 case XK_Alt_L:
534 case XK_Alt_R: g_alt_mask |= mask; break;
535
536 case XK_Super_L:
537 case XK_Super_R: g_super_mask |= mask; break;
538
539 case XK_Hyper_L:
540 case XK_Hyper_R: g_hyper_mask |= mask; break;
541
542 case XK_Meta_L:
543 case XK_Meta_R: g_meta_mask |= mask; break;
544
545 case XK_Num_Lock: g_modXNumLock |= mask; break;
546 case XK_Scroll_Lock: g_modXScrollLock |= mask; break;
547 case XK_Mode_switch: g_modXModeSwitch |= mask; break;
548 }
549 }
550 }
551 }
552
553#ifdef KKEYSERVER_DEBUG
554 kDebug() << "Alt:" << g_alt_mask;
555 kDebug() << "Meta:" << g_meta_mask;
556 kDebug() << "Super:" << g_super_mask;
557 kDebug() << "Hyper:" << g_hyper_mask;
558 kDebug() << "NumLock:" << g_modXNumLock;
559 kDebug() << "ScrollLock:" << g_modXScrollLock;
560 kDebug() << "ModeSwitch:" << g_modXModeSwitch;
561#endif
562
563 // Check if hyper overlaps with super or meta or alt
564 if (g_hyper_mask&(g_super_mask|g_meta_mask|g_alt_mask)) {
565#ifdef KKEYSERVER_DEBUG
566 kDebug() << "Hyper conflicts with super, meta or alt.";
567#endif
568 // Remove the conflicting masks
569 g_hyper_mask &= ~(g_super_mask|g_meta_mask|g_alt_mask);
570 }
571
572 // Check if super overlaps with meta or alt
573 if (g_super_mask&(g_meta_mask|g_alt_mask)) {
574#ifdef KKEYSERVER_DEBUG
575 kDebug() << "Super conflicts with meta or alt.";
576#endif
577 // Remove the conflicting masks
578 g_super_mask &= ~(g_meta_mask|g_alt_mask);
579 }
580
581
582 // Check if meta overlaps with alt
583 if (g_meta_mask|g_alt_mask) {
584#ifdef KKEYSERVER_DEBUG
585 kDebug() << "Meta conflicts with alt.";
586#endif
587 // Remove the conflicting masks
588 g_meta_mask &= ~(g_alt_mask);
589 }
590
591 if (!g_meta_mask) {
592#ifdef KKEYSERVER_DEBUG
593 kDebug() << "Meta is not set or conflicted with alt.";
594#endif
595 if (g_super_mask) {
596#ifdef KKEYSERVER_DEBUG
597 kDebug() << "Using super for meta";
598#endif
599 // Use Super
600 g_meta_mask = g_super_mask;
601 } else if (g_hyper_mask) {
602#ifdef KKEYSERVER_DEBUG
603 kDebug() << "Using hyper for meta";
604#endif
605 // User Hyper
606 g_meta_mask = g_hyper_mask;
607 } else {
608 // ???? Nothing left
609 g_meta_mask = 0;
610 }
611 }
612
613#ifdef KKEYSERVER_DEBUG
614 kDebug() << "Alt:" << g_alt_mask;
615 kDebug() << "Meta:" << g_meta_mask;
616 kDebug() << "Super:" << g_super_mask;
617 kDebug() << "Hyper:" << g_hyper_mask;
618 kDebug() << "NumLock:" << g_modXNumLock;
619 kDebug() << "ScrollLock:" << g_modXScrollLock;
620 kDebug() << "ModeSwitch:" << g_modXModeSwitch;
621#endif
622
623 if (!g_meta_mask) {
624 kWarning() << "Your keyboard setup doesn't provide a key to use for meta. See 'xmodmap -pm' or 'xkbcomp $DISPLAY'";
625 }
626
627 g_rgX11ModInfo[2].modX = g_alt_mask;
628 g_rgX11ModInfo[3].modX = g_meta_mask;
629
630 XFreeModifiermap( xmk );
631 g_bInitializedMods = true;
632
633 return true;
634}
635
636
637//---------------------------------------------------------------------
638// Public functions
639//---------------------------------------------------------------------
640
641
642uint modXShift() { return ShiftMask; }
643uint modXCtrl() { return ControlMask; }
644uint modXAlt() { if( !g_bInitializedMods ) { initializeMods(); } return g_alt_mask; }
645uint modXMeta() { if( !g_bInitializedMods ) { initializeMods(); } return g_meta_mask; }
646
647uint modXNumLock() { if( !g_bInitializedMods ) { initializeMods(); } return g_modXNumLock; }
648uint modXLock() { return LockMask; }
649uint modXScrollLock() { if( !g_bInitializedMods ) { initializeMods(); } return g_modXScrollLock; }
650uint modXModeSwitch() { if( !g_bInitializedMods ) { initializeMods(); } return g_modXModeSwitch; }
651
652bool keyboardHasMetaKey() { return modXMeta() != 0; }
653
654
655uint getModsRequired(uint sym)
656{
657 uint mod = 0;
658
659 // FIXME: This might not be true on all keyboard layouts!
660 if( sym == XK_Sys_Req ) return Qt::ALT;
661 if( sym == XK_Break ) return Qt::CTRL;
662
663 if( sym < 0x3000 ) {
664 QChar c(sym);
665 if( c.isLetter() && c.toLower() != c.toUpper() && sym == c.toUpper().unicode() )
666 return Qt::SHIFT;
667 }
668
669 uchar code = XKeysymToKeycode( QX11Info::display(), sym );
670 if( code ) {
671 // need to check index 0 before the others, so that a null-mod
672 // can take precedence over the others, in case the modified
673 // key produces the same symbol.
674 if( sym == XKeycodeToKeysym( QX11Info::display(), code, 0 ) )
675 ;
676 else if( sym == XKeycodeToKeysym( QX11Info::display(), code, 1 ) )
677 mod = Qt::SHIFT;
678 else if( sym == XKeycodeToKeysym( QX11Info::display(), code, 2 ) )
679 mod = MODE_SWITCH;
680 else if( sym == XKeycodeToKeysym( QX11Info::display(), code, 3 ) )
681 mod = Qt::SHIFT | MODE_SWITCH;
682 }
683 return mod;
684}
685
686bool keyQtToCodeX( int keyQt, int* keyCode )
687{
688 int sym;
689 uint mod;
690 keyQtToSymX(keyQt, &sym);
691 keyQtToModX(keyQt, &mod);
692
693 // Get any extra mods required by the sym.
694 // E.g., XK_Plus requires SHIFT on the en layout.
695 uint modExtra = getModsRequired(sym);
696 // Get the X modifier equivalent.
697 if( !sym || !keyQtToModX( (keyQt & Qt::KeyboardModifierMask) | modExtra, &mod ) ) {
698 *keyCode = 0;
699 return false;
700 }
701
702 *keyCode = XKeysymToKeycode( QX11Info::display(), sym );
703 return true;
704}
705
706bool keyQtToSymX( int keyQt, int* keySym )
707{
708 int symQt = keyQt & ~Qt::KeyboardModifierMask;
709
710 if( symQt < 0x1000 ) {
711 *keySym = QChar(symQt).toUpper().unicode();
712 return true;
713 }
714
715
716 for( uint i = 0; i < sizeof(g_rgQtToSymX)/sizeof(TransKey); i++ ) {
717 if( g_rgQtToSymX[i].keySymQt == symQt ) {
718 *keySym = g_rgQtToSymX[i].keySymX;
719 return true;
720 }
721 }
722
723 *keySym = 0;
724 if( symQt != Qt::Key_Shift && symQt != Qt::Key_Control && symQt != Qt::Key_Alt &&
725 symQt != Qt::Key_Meta && symQt != Qt::Key_Direction_L && symQt != Qt::Key_Direction_R )
726 kDebug(125) << "Sym::initQt( " << QString::number(keyQt,16) << " ): failed to convert key.";
727 return false;
728}
729
730bool symXToKeyQt( uint keySym, int* keyQt )
731{
732 *keyQt = Qt::Key_unknown;
733 if( keySym < 0x1000 ) {
734 if( keySym >= 'a' && keySym <= 'z' )
735 *keyQt = QChar(keySym).toUpper().unicode();
736 else
737 *keyQt = keySym;
738 }
739
740 else if( keySym < 0x3000 )
741 *keyQt = keySym;
742
743 else {
744 for( uint i = 0; i < sizeof(g_rgQtToSymX)/sizeof(TransKey); i++ )
745 if( g_rgQtToSymX[i].keySymX == keySym ) {
746 *keyQt = g_rgQtToSymX[i].keySymQt;
747 break;
748 }
749 }
750
751 return (*keyQt != Qt::Key_unknown);
752}
753
754/* are these things actually used anywhere? there's no way
755 they can do anything on non-X11 */
756
757bool keyQtToModX( int modQt, uint* modX )
758{
759 if( !g_bInitializedMods )
760 initializeMods();
761
762 *modX = 0;
763 for( int i = 0; i < 4; i++ ) {
764
765 if( modQt & g_rgX11ModInfo[i].modQt ) {
766 if( g_rgX11ModInfo[i].modX ) {
767 *modX |= g_rgX11ModInfo[i].modX;
768 } else {
769 // The qt modifier has no x equivalent. Return false
770 return false;
771 }
772 }
773 }
774 return true;
775}
776
777bool modXToQt( uint modX, int* modQt )
778{
779 if( !g_bInitializedMods )
780 initializeMods();
781
782 *modQt = 0;
783 for( int i = 0; i < 4; i++ ) {
784 if( modX & g_rgX11ModInfo[i].modX ) {
785 *modQt |= g_rgX11ModInfo[i].modQt;
786 continue;
787 }
788 }
789 return true;
790}
791
792
793bool codeXToSym( uchar codeX, uint modX, uint* sym )
794{
795 KeySym keySym;
796 XKeyPressedEvent event;
797
798 checkDisplay();
799
800 event.type = KeyPress;
801 event.display = QX11Info::display();
802 event.state = modX;
803 event.keycode = codeX;
804
805 XLookupString( &event, 0, 0, &keySym, 0 );
806 *sym = (uint) keySym;
807 return true;
808}
809
810
811uint accelModMaskX()
812{
813 return modXShift() | modXCtrl() | modXAlt() | modXMeta();
814}
815
816
817bool xEventToQt( XEvent* e, int* keyQt )
818{
819 Q_ASSERT(e->type == KeyPress || e->type == KeyRelease);
820
821 uchar keyCodeX = e->xkey.keycode;
822 uint keyModX = e->xkey.state & (accelModMaskX() | MODE_SWITCH);
823
824 KeySym keySym;
825 char buffer[16];
826 XLookupString( (XKeyEvent*) e, buffer, 15, &keySym, 0 );
827 uint keySymX = (uint)keySym;
828
829 // If numlock is active and a keypad key is pressed, XOR the SHIFT state.
830 // e.g., KP_4 => Shift+KP_Left, and Shift+KP_4 => KP_Left.
831 if( e->xkey.state & modXNumLock() ) {
832 uint sym = XKeycodeToKeysym( QX11Info::display(), keyCodeX, 0 );
833 // TODO: what's the xor operator in c++?
834 // If this is a keypad key,
835 if( sym >= XK_KP_Space && sym <= XK_KP_9 ) {
836 switch( sym ) {
837 // Leave the following keys unaltered
838 // FIXME: The proper solution is to see which keysyms don't change when shifted.
839 case XK_KP_Multiply:
840 case XK_KP_Add:
841 case XK_KP_Subtract:
842 case XK_KP_Divide:
843 break;
844 default:
845 if( keyModX & modXShift() )
846 keyModX &= ~modXShift();
847 else
848 keyModX |= modXShift();
849 }
850 }
851 }
852
853 int keyCodeQt;
854 int keyModQt;
855 symXToKeyQt(keySymX, &keyCodeQt);
856 modXToQt(keyModX, &keyModQt);
857
858 *keyQt = keyCodeQt | keyModQt;
859 return true;
860}
861
862
863} // end of namespace KKeyServer block
kDebug
#define kDebug
kWarning
#define kWarning
mask
#define mask
kdebug.h
XF86XK_News
#define XF86XK_News
XF86XK_Explorer
#define XF86XK_Explorer
XF86XK_Clear
#define XF86XK_Clear
XF86XK_AudioMute
#define XF86XK_AudioMute
XF86XK_Standby
#define XF86XK_Standby
XF86XK_Launch9
#define XF86XK_Launch9
XF86XK_AudioStop
#define XF86XK_AudioStop
XF86XK_Terminal
#define XF86XK_Terminal
XF86XK_Select
#define XF86XK_Select
XF86XK_DOS
#define XF86XK_DOS
XF86XK_Reply
#define XF86XK_Reply
XF86XK_MonBrightnessDown
#define XF86XK_MonBrightnessDown
XF86XK_KbdBrightnessDown
#define XF86XK_KbdBrightnessDown
XF86XK_Phone
#define XF86XK_Phone
XF86XK_Send
#define XF86XK_Send
XF86XK_Cut
#define XF86XK_Cut
XF86XK_Documents
#define XF86XK_Documents
XF86XK_Eject
#define XF86XK_Eject
XF86XK_Refresh
#define XF86XK_Refresh
XF86XK_Search
#define XF86XK_Search
XF86XK_ApplicationLeft
#define XF86XK_ApplicationLeft
XF86XK_WakeUp
#define XF86XK_WakeUp
XF86XK_Calculator
#define XF86XK_Calculator
XF86XK_Paste
#define XF86XK_Paste
XF86XK_PowerDown
#define XF86XK_PowerDown
XF86XK_AudioMedia
#define XF86XK_AudioMedia
XF86XK_AudioRandomPlay
#define XF86XK_AudioRandomPlay
XF86XK_ContrastAdjust
#define XF86XK_ContrastAdjust
XF86XK_Favorites
#define XF86XK_Favorites
XF86XK_Back
#define XF86XK_Back
XF86XK_KbdBrightnessUp
#define XF86XK_KbdBrightnessUp
XF86XK_Display
#define XF86XK_Display
XF86XK_Calculater
#define XF86XK_Calculater
XF86XK_Reload
#define XF86XK_Reload
XF86XK_ZoomIn
#define XF86XK_ZoomIn
XF86XK_ApplicationRight
#define XF86XK_ApplicationRight
XF86XK_Stop
#define XF86XK_Stop
XF86XK_iTouch
#define XF86XK_iTouch
XF86XK_Tools
#define XF86XK_Tools
XF86XK_Book
#define XF86XK_Book
XF86XK_Calendar
#define XF86XK_Calendar
XF86XK_PowerOff
#define XF86XK_PowerOff
XF86XK_AudioRewind
#define XF86XK_AudioRewind
XF86XK_Subtitle
#define XF86XK_Subtitle
XF86XK_Launch4
#define XF86XK_Launch4
XF86XK_Music
#define XF86XK_Music
XF86XK_LogOff
#define XF86XK_LogOff
XF86XK_Launch1
#define XF86XK_Launch1
XF86XK_OpenURL
#define XF86XK_OpenURL
XF86XK_View
#define XF86XK_View
XF86XK_LaunchB
#define XF86XK_LaunchB
XF86XK_Launch6
#define XF86XK_Launch6
XF86XK_HomePage
#define XF86XK_HomePage
XF86XK_AudioRaiseVolume
#define XF86XK_AudioRaiseVolume
XF86XK_SplitScreen
#define XF86XK_SplitScreen
XF86XK_WebCam
#define XF86XK_WebCam
XF86XK_Time
#define XF86XK_Time
XF86XK_AudioRecord
#define XF86XK_AudioRecord
XF86XK_KbdLightOnOff
#define XF86XK_KbdLightOnOff
XF86XK_LaunchA
#define XF86XK_LaunchA
XF86XK_Community
#define XF86XK_Community
XF86XK_WWW
#define XF86XK_WWW
XF86XK_ToDoList
#define XF86XK_ToDoList
XF86XK_Forward
#define XF86XK_Forward
XF86XK_Launch7
#define XF86XK_Launch7
XF86XK_Excel
#define XF86XK_Excel
XF86XK_Battery
#define XF86XK_Battery
XF86XK_Support
#define XF86XK_Support
XF86XK_HotLinks
#define XF86XK_HotLinks
XF86XK_Bluetooth
#define XF86XK_Bluetooth
XF86XK_Pictures
#define XF86XK_Pictures
XF86XK_MonBrightnessUp
#define XF86XK_MonBrightnessUp
XF86XK_AudioCycleTrack
#define XF86XK_AudioCycleTrack
XF86XK_Messenger
#define XF86XK_Messenger
XF86XK_RotationPB
#define XF86XK_RotationPB
XF86XK_MailForward
#define XF86XK_MailForward
XF86XK_MenuKB
#define XF86XK_MenuKB
XF86XK_Memo
#define XF86XK_Memo
XF86XK_TopMenu
#define XF86XK_TopMenu
XF86XK_Spell
#define XF86XK_Spell
XF86XK_TaskPane
#define XF86XK_TaskPane
XF86XK_CD
#define XF86XK_CD
XF86XK_AudioNext
#define XF86XK_AudioNext
XF86XK_Close
#define XF86XK_Close
XF86XK_ScreenSaver
#define XF86XK_ScreenSaver
XF86XK_Xfer
#define XF86XK_Xfer
XF86XK_Save
#define XF86XK_Save
XF86XK_Launch2
#define XF86XK_Launch2
XF86XK_Sleep
#define XF86XK_Sleep
XF86XK_Shop
#define XF86XK_Shop
XF86XK_Finance
#define XF86XK_Finance
X11_ONLY
#define X11_ONLY(arg)
Definition: kkeyserver_x11.cpp:35
XF86XK_Video
#define XF86XK_Video
XF86XK_LaunchC
#define XF86XK_LaunchC
XF86XK_Mail
#define XF86XK_Mail
XF86XK_Meeting
#define XF86XK_Meeting
XF86XK_RotateWindows
#define XF86XK_RotateWindows
XF86XK_Launch8
#define XF86XK_Launch8
XF86XK_LightBulb
#define XF86XK_LightBulb
XF86XK_AudioLowerVolume
#define XF86XK_AudioLowerVolume
XF86XK_MySites
#define XF86XK_MySites
XF86XK_WLAN
#define XF86XK_WLAN
XF86XK_ZoomOut
#define XF86XK_ZoomOut
XF86XK_Market
#define XF86XK_Market
XF86XK_AddFavorite
#define XF86XK_AddFavorite
XF86XK_History
#define XF86XK_History
XF86XK_AudioPlay
#define XF86XK_AudioPlay
XF86XK_Launch0
#define XF86XK_Launch0
XF86XK_ClearGrab
#define XF86XK_ClearGrab
XF86XK_BackForward
#define XF86XK_BackForward
XF86XK_Hibernate
#define XF86XK_Hibernate
XF86XK_Word
#define XF86XK_Word
XF86XK_LaunchD
#define XF86XK_LaunchD
XF86XK_Go
#define XF86XK_Go
XF86XK_AudioForward
#define XF86XK_AudioForward
XF86XK_Travel
#define XF86XK_Travel
XF86XK_Launch3
#define XF86XK_Launch3
XF86XK_Away
#define XF86XK_Away
XF86XK_Suspend
#define XF86XK_Suspend
XF86XK_Launch5
#define XF86XK_Launch5
XF86XK_RotationKB
#define XF86XK_RotationKB
XF86XK_OfficeHome
#define XF86XK_OfficeHome
XF86XK_MyComputer
#define XF86XK_MyComputer
XF86XK_MenuPB
#define XF86XK_MenuPB
XF86XK_Game
#define XF86XK_Game
XF86XK_BrightnessAdjust
#define XF86XK_BrightnessAdjust
XF86XK_UWB
#define XF86XK_UWB
XF86XK_AudioRepeat
#define XF86XK_AudioRepeat
XF86XK_AudioPrev
#define XF86XK_AudioPrev
XF86XK_Copy
#define XF86XK_Copy
XF86XK_Option
#define XF86XK_Option
kkeyserver_x11.h
klocale.h
I18N_NOOP
#define I18N_NOOP(x)
KKeyServer
A collection of functions for the conversion of key presses and their modifiers from the window syste...
Definition: kkeyserver.cpp:31
KKeyServer::modXModeSwitch
uint modXModeSwitch()
Returns the X11 Mode_switch modifier mask/flag.
Definition: kkeyserver_x11.cpp:650
KKeyServer::modXMeta
uint modXMeta()
Returns the X11 Win (Mod3) modifier mask/flag.
Definition: kkeyserver_x11.cpp:645
KKeyServer::symXToKeyQt
bool symXToKeyQt(uint keySym, int *keyQt)
Converts the given symbol to a Qt key code.
Definition: kkeyserver_x11.cpp:730
KKeyServer::codeXToSym
bool codeXToSym(uchar codeX, uint modX, uint *sym)
Definition: kkeyserver_x11.cpp:793
KKeyServer::g_alt_mask
static uint g_alt_mask
Definition: kkeyserver_x11.cpp:496
KKeyServer::g_modXScrollLock
static uint g_modXScrollLock
Definition: kkeyserver_x11.cpp:496
KKeyServer::xEventToQt
bool xEventToQt(XEvent *e, int *keyQt)
Converts an X keypress event into a Qt key + modifier code.
Definition: kkeyserver_x11.cpp:817
KKeyServer::checkDisplay
void checkDisplay()
Definition: kkeyserver_x11.cpp:478
KKeyServer::keyboardHasMetaKey
bool keyboardHasMetaKey()
Returns true if the current keyboard layout supports the Meta key.
Definition: kkeyserver_x11.cpp:652
KKeyServer::MODE_SWITCH
static const int MODE_SWITCH
Definition: kkeyserver_x11.h:32
KKeyServer::g_rgQtToSymX
static const TransKey g_rgQtToSymX[]
Definition: kkeyserver_x11.cpp:119
KKeyServer::modXShift
uint modXShift()
Returns the X11 Shift modifier mask/flag.
Definition: kkeyserver_x11.cpp:642
KKeyServer::modXNumLock
uint modXNumLock()
Returns the X11 NumLock modifier mask/flag.
Definition: kkeyserver_x11.cpp:647
KKeyServer::keyQtToCodeX
bool keyQtToCodeX(int keyQt, int *keyCode)
Extracts the code from the given Qt key.
Definition: kkeyserver_x11.cpp:686
KKeyServer::modXToQt
bool modXToQt(uint modX, int *modQt)
Converts the mask of ORed X11 modifiers to a mask of ORed Qt key code modifiers.
Definition: kkeyserver_x11.cpp:777
KKeyServer::g_modXModeSwitch
static uint g_modXModeSwitch
Definition: kkeyserver_x11.cpp:496
KKeyServer::modXLock
uint modXLock()
Returns the X11 Lock modifier mask/flag.
Definition: kkeyserver_x11.cpp:648
KKeyServer::keyQtToSymX
bool keyQtToSymX(int keyQt, int *keySym)
Extracts the symbol from the given Qt key and converts it to an X11 symbol + modifiers.
Definition: kkeyserver_x11.cpp:706
KKeyServer::g_bInitializedMods
static bool g_bInitializedMods
Definition: kkeyserver_x11.cpp:495
KKeyServer::g_modXNumLock
static uint g_modXNumLock
Definition: kkeyserver_x11.cpp:496
KKeyServer::accelModMaskX
uint accelModMaskX()
Returns bitwise OR'ed mask containing Shift, Ctrl, Alt, and Win (if available).
Definition: kkeyserver_x11.cpp:811
KKeyServer::modXAlt
uint modXAlt()
Returns the X11 Alt (Mod1) modifier mask/flag.
Definition: kkeyserver_x11.cpp:644
KKeyServer::modXScrollLock
uint modXScrollLock()
Returns the X11 ScrollLock modifier mask/flag.
Definition: kkeyserver_x11.cpp:649
KKeyServer::g_meta_mask
static uint g_meta_mask
Definition: kkeyserver_x11.cpp:496
KKeyServer::g_hyper_mask
static uint g_hyper_mask
Definition: kkeyserver_x11.cpp:496
KKeyServer::g_rgSymNames
static const SymName g_rgSymNames[]
Definition: kkeyserver_x11.cpp:93
KKeyServer::g_rgX11ModInfo
static X11ModInfo g_rgX11ModInfo[4]
Definition: kkeyserver_x11.cpp:84
KKeyServer::getModsRequired
uint getModsRequired(uint sym)
Definition: kkeyserver_x11.cpp:655
KKeyServer::initializeMods
bool initializeMods()
Initialises the values to return for the mod*() functions below.
Definition: kkeyserver_x11.cpp:498
KKeyServer::keyQtToModX
bool keyQtToModX(int modQt, uint *modX)
Extracts the modifiers from the given Qt key and converts them in a mask of X11 modifiers.
Definition: kkeyserver_x11.cpp:757
KKeyServer::modXCtrl
uint modXCtrl()
Returns the X11 Ctrl modifier mask/flag.
Definition: kkeyserver_x11.cpp:643
KKeyServer::g_super_mask
static uint g_super_mask
Definition: kkeyserver_x11.cpp:496
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Feb 20 2023 00:00:00 by doxygen 1.9.6 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEUI

Skip menu "KDEUI"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs-4.14.38 API Reference

Skip menu "kdelibs-4.14.38 API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal