• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

  • tdecore
kkeyserver_x11.cpp
1 /*
2  Copyright (C) 2001 Ellis Whitehead <ellis@kde.org>
3 
4  Win32 port:
5  Copyright (C) 2004 Jaroslaw Staniek <js@iidea.pl>
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 <config.h>
24 
25 #include <tqnamespace.h>
26 #include <tqwindowdefs.h>
27 
28 #if defined(Q_WS_X11) || defined(Q_WS_WIN) || defined(Q_WS_MACX) // Only compile this module if we're compiling for X11, mac or win32
29 
30 #include "kkeyserver_x11.h"
31 #include "kkeynative.h"
32 #include "tdeshortcut.h"
33 
34 #include <tdeconfig.h>
35 #include <kdebug.h>
36 #include <tdeglobal.h>
37 #include <tdelocale.h>
38 
39 #ifdef Q_WS_X11
40 # define XK_MISCELLANY
41 # define XK_XKB_KEYS
42 # include <X11/X.h>
43 # include <X11/Xlib.h>
44 # include <X11/Xutil.h>
45 # include <X11/XKBlib.h>
46 # include <X11/keysymdef.h>
47 # define X11_ONLY(arg) arg, //allows to omit an argument
48 #else
49 # include <kckey.h>
50 # define X11_ONLY(arg)
51 # define XK_ISO_Left_Tab Qt::Key_Backtab
52 # define XK_BackSpace Qt::Key_Backspace
53 # define XK_Sys_Req Qt::Key_SysReq
54 # define XK_Caps_Lock Qt::Key_CapsLock
55 # define XK_Num_Lock Qt::Key_NumLock
56 # define XK_Scroll_Lock Qt::Key_ScrollLock
57 # define XK_Prior Qt::Key_Prior
58 # define XK_Next Qt::Key_Next
59 #endif
60 
61 namespace KKeyServer
62 {
63 
64 //---------------------------------------------------------------------
65 // Data Structures
66 //---------------------------------------------------------------------
67 
68 struct Mod
69 {
70  int m_mod;
71 };
72 
73 //---------------------------------------------------------------------
74 // Array Structures
75 //---------------------------------------------------------------------
76 
77 struct ModInfo
78 {
79  KKey::ModFlag mod;
80  int modQt;
81 #ifdef Q_WS_X11
82  uint modX;
83 #endif
84  const char* psName;
85  TQString sLabel;
86 };
87 
88 struct SymVariation
89 {
90  uint sym, symVariation;
91  bool bActive;
92 };
93 
94 struct SymName
95 {
96  uint sym;
97  const char* psName;
98 };
99 
100 struct TransKey {
101  int keySymQt;
102  uint keySymX;
103 };
104 
105 //---------------------------------------------------------------------
106 // Arrays
107 //---------------------------------------------------------------------
108 
109 static ModInfo g_rgModInfo[KKey::MOD_FLAG_COUNT] =
110 {
111  { KKey::SHIFT, Qt::SHIFT, X11_ONLY(ShiftMask) I18N_NOOP("Shift"), TQString() },
112  { KKey::CTRL, Qt::CTRL, X11_ONLY(ControlMask) I18N_NOOP("Ctrl"), TQString() },
113  { KKey::ALT, Qt::ALT, X11_ONLY(Mod1Mask) I18N_NOOP("Alt"), TQString() },
114  { KKey::WIN, KKey::QtWIN, X11_ONLY(Mod4Mask) I18N_NOOP("Win"), TQString() }
115 };
116 
117 // Special Names List
118 static const SymName g_rgSymNames[] = {
119  { XK_ISO_Left_Tab, "Backtab" },
120  { XK_BackSpace, I18N_NOOP("Backspace") },
121  { XK_Sys_Req, I18N_NOOP("SysReq") },
122  { XK_Caps_Lock, I18N_NOOP("CapsLock") },
123  { XK_Num_Lock, I18N_NOOP("NumLock") },
124  { XK_Scroll_Lock, I18N_NOOP("ScrollLock") },
125  { XK_Prior, I18N_NOOP("PageUp") },
126  { XK_Next, I18N_NOOP("PageDown") },
127 #ifdef sun
128  { XK_F11, I18N_NOOP("Stop") },
129  { XK_F12, I18N_NOOP("Again") },
130  { XK_F13, I18N_NOOP("Props") },
131  { XK_F14, I18N_NOOP("Undo") },
132  { XK_F15, I18N_NOOP("Front") },
133  { XK_F16, I18N_NOOP("Copy") },
134  { XK_F17, I18N_NOOP("Open") },
135  { XK_F18, I18N_NOOP("Paste") },
136  { XK_F19, I18N_NOOP("Find") },
137  { XK_F20, I18N_NOOP("Cut") },
138  { XK_F22, I18N_NOOP("Print") },
139 #endif
140  { 0, 0 }
141 };
142 
143 #ifdef Q_WS_X11
144 static SymVariation g_rgSymVariation[] =
145 {
146  { '/', XK_KP_Divide, false },
147  { '*', XK_KP_Multiply, false },
148  { '-', XK_KP_Subtract, false },
149  { '+', XK_KP_Add, false },
150  { XK_Return, XK_KP_Enter, false },
151  { 0, 0, false }
152 };
153 
154 // TODO: Add Mac key names list: Key_Backspace => "Delete", Key_Delete => "Del"
155 
156 // These are the X equivalents to the Qt keycodes 0x1000 - 0x1026
157 static const TransKey g_rgQtToSymX[] =
158 {
159  { Qt::Key_Escape, XK_Escape },
160  { Qt::Key_Tab, XK_Tab },
161  { Qt::Key_Backtab, XK_ISO_Left_Tab },
162  { Qt::Key_Backspace, XK_BackSpace },
163  { Qt::Key_Return, XK_Return },
164  { Qt::Key_Enter, XK_KP_Enter },
165  { Qt::Key_Insert, XK_Insert },
166  { Qt::Key_Delete, XK_Delete },
167  { Qt::Key_Pause, XK_Pause },
168 #ifdef sun
169  { Qt::Key_Print, XK_F22 },
170 #else
171  { Qt::Key_Print, XK_Print },
172 #endif
173  { Qt::Key_SysReq, XK_Sys_Req },
174  { Qt::Key_Home, XK_Home },
175  { Qt::Key_End, XK_End },
176  { Qt::Key_Left, XK_Left },
177  { Qt::Key_Up, XK_Up },
178  { Qt::Key_Right, XK_Right },
179  { Qt::Key_Down, XK_Down },
180  { TQt::Key_Prior, XK_Prior },
181  { TQt::Key_Next, XK_Next },
182  //{ Qt::Key_Shift, 0 },
183  //{ Qt::Key_Control, 0 },
184  //{ Qt::Key_Meta, 0 },
185  //{ Qt::Key_Alt, 0 },
186  { Qt::Key_CapsLock, XK_Caps_Lock },
187  { Qt::Key_NumLock, XK_Num_Lock },
188  { Qt::Key_ScrollLock, XK_Scroll_Lock },
189  { Qt::Key_F1, XK_F1 },
190  { Qt::Key_F2, XK_F2 },
191  { Qt::Key_F3, XK_F3 },
192  { Qt::Key_F4, XK_F4 },
193  { Qt::Key_F5, XK_F5 },
194  { Qt::Key_F6, XK_F6 },
195  { Qt::Key_F7, XK_F7 },
196  { Qt::Key_F8, XK_F8 },
197  { Qt::Key_F9, XK_F9 },
198  { Qt::Key_F10, XK_F10 },
199  { Qt::Key_F11, XK_F11 },
200  { Qt::Key_F12, XK_F12 },
201  { Qt::Key_F13, XK_F13 },
202  { Qt::Key_F14, XK_F14 },
203  { Qt::Key_F15, XK_F15 },
204  { Qt::Key_F16, XK_F16 },
205  { Qt::Key_F17, XK_F17 },
206  { Qt::Key_F18, XK_F18 },
207  { Qt::Key_F19, XK_F19 },
208  { Qt::Key_F20, XK_F20 },
209  { Qt::Key_F21, XK_F21 },
210  { Qt::Key_F22, XK_F22 },
211  { Qt::Key_F23, XK_F23 },
212  { Qt::Key_F24, XK_F24 },
213  { Qt::Key_F25, XK_F25 },
214  { Qt::Key_F26, XK_F26 },
215  { Qt::Key_F27, XK_F27 },
216  { Qt::Key_F28, XK_F28 },
217  { Qt::Key_F29, XK_F29 },
218  { Qt::Key_F30, XK_F30 },
219  { Qt::Key_F31, XK_F31 },
220  { Qt::Key_F32, XK_F32 },
221  { Qt::Key_F33, XK_F33 },
222  { Qt::Key_F34, XK_F34 },
223  { Qt::Key_F35, XK_F35 },
224  { Qt::Key_Super_L, XK_Super_L },
225  { Qt::Key_Super_R, XK_Super_R },
226  { Qt::Key_Menu, XK_Menu },
227  { Qt::Key_Hyper_L, XK_Hyper_L },
228  { Qt::Key_Hyper_R, XK_Hyper_R },
229  { Qt::Key_Help, XK_Help },
230  //{ Qt::Key_Direction_L, XK_Direction_L }, These keys don't exist in X11
231  //{ Qt::Key_Direction_R, XK_Direction_R },
232 
233  { '/', XK_KP_Divide },
234  { '*', XK_KP_Multiply },
235  { '-', XK_KP_Subtract },
236  { '+', XK_KP_Add },
237  { Qt::Key_Return, XK_KP_Enter }
238 #if TQT_VERSION >= 0x030100
239 
240 // the next lines are taken from XFree > 4.0 (X11/XF86keysyms.h), defining some special
241 // multimedia keys. They are included here as not every system has them.
242 #define XF86XK_Standby 0x1008FF10
243 #define XF86XK_AudioLowerVolume 0x1008FF11
244 #define XF86XK_AudioMute 0x1008FF12
245 #define XF86XK_AudioRaiseVolume 0x1008FF13
246 #define XF86XK_AudioPlay 0x1008FF14
247 #define XF86XK_AudioStop 0x1008FF15
248 #define XF86XK_AudioPrev 0x1008FF16
249 #define XF86XK_AudioNext 0x1008FF17
250 #define XF86XK_HomePage 0x1008FF18
251 #define XF86XK_Calculator 0x1008FF1D
252 #define XF86XK_Mail 0x1008FF19
253 #define XF86XK_Start 0x1008FF1A
254 #define XF86XK_Search 0x1008FF1B
255 #define XF86XK_AudioRecord 0x1008FF1C
256 #define XF86XK_Back 0x1008FF26
257 #define XF86XK_Forward 0x1008FF27
258 #define XF86XK_Stop 0x1008FF28
259 #define XF86XK_Refresh 0x1008FF29
260 #define XF86XK_Favorites 0x1008FF30
261 #define XF86XK_AudioPause 0x1008FF31
262 #define XF86XK_AudioMedia 0x1008FF32
263 #define XF86XK_MyComputer 0x1008FF33
264 #define XF86XK_OpenURL 0x1008FF38
265 #define XF86XK_Launch0 0x1008FF40
266 #define XF86XK_Launch1 0x1008FF41
267 #define XF86XK_Launch2 0x1008FF42
268 #define XF86XK_Launch3 0x1008FF43
269 #define XF86XK_Launch4 0x1008FF44
270 #define XF86XK_Launch5 0x1008FF45
271 #define XF86XK_Launch6 0x1008FF46
272 #define XF86XK_Launch7 0x1008FF47
273 #define XF86XK_Launch8 0x1008FF48
274 #define XF86XK_Launch9 0x1008FF49
275 #define XF86XK_LaunchA 0x1008FF4A
276 #define XF86XK_LaunchB 0x1008FF4B
277 #define XF86XK_LaunchC 0x1008FF4C
278 #define XF86XK_LaunchD 0x1008FF4D
279 #define XF86XK_LaunchE 0x1008FF4E
280 #define XF86XK_LaunchF 0x1008FF4F
281 #define XF86XK_MonBrightnessUp 0x1008FF02 /* Monitor/panel brightness */
282 #define XF86XK_MonBrightnessDown 0x1008FF03 /* Monitor/panel brightness */
283 #define XF86XK_KbdLightOnOff 0x1008FF04 /* Keyboards may be lit */
284 #define XF86XK_KbdBrightnessUp 0x1008FF05 /* Keyboards may be lit */
285 #define XF86XK_KbdBrightnessDown 0x1008FF06 /* Keyboards may be lit */
286 // end of XF86keysyms.h
287  ,
288  { Qt::Key_Standby, XF86XK_Standby },
289  { Qt::Key_VolumeDown, XF86XK_AudioLowerVolume },
290  { Qt::Key_VolumeMute, XF86XK_AudioMute },
291  { Qt::Key_VolumeUp, XF86XK_AudioRaiseVolume },
292  { Qt::Key_MediaPlay, XF86XK_AudioPlay },
293  { Qt::Key_MediaStop, XF86XK_AudioStop },
294  { TQt::Key_MediaPrev, XF86XK_AudioPrev },
295  { Qt::Key_MediaNext, XF86XK_AudioNext },
296  { Qt::Key_HomePage, XF86XK_HomePage },
297  { Qt::Key_LaunchMail, XF86XK_Mail },
298  { Qt::Key_Search, XF86XK_Search },
299  { Qt::Key_MediaRecord, XF86XK_AudioRecord },
300  { Qt::Key_LaunchMedia, XF86XK_AudioMedia },
301  { Qt::Key_Launch1, XF86XK_Calculator },
302  { Qt::Key_Back, XF86XK_Back },
303  { Qt::Key_Forward, XF86XK_Forward },
304  { Qt::Key_Stop, XF86XK_Stop },
305  { Qt::Key_Refresh, XF86XK_Refresh },
306  { Qt::Key_Favorites, XF86XK_Favorites },
307  { Qt::Key_Launch0, XF86XK_MyComputer },
308  { Qt::Key_OpenUrl, XF86XK_OpenURL },
309  { Qt::Key_Launch2, XF86XK_Launch0 },
310  { Qt::Key_Launch3, XF86XK_Launch1 },
311  { Qt::Key_Launch4, XF86XK_Launch2 },
312  { Qt::Key_Launch5, XF86XK_Launch3 },
313  { Qt::Key_Launch6, XF86XK_Launch4 },
314  { Qt::Key_Launch7, XF86XK_Launch5 },
315  { Qt::Key_Launch8, XF86XK_Launch6 },
316  { Qt::Key_Launch9, XF86XK_Launch7 },
317  { Qt::Key_LaunchA, XF86XK_Launch8 },
318  { Qt::Key_LaunchB, XF86XK_Launch9 },
319  { Qt::Key_LaunchC, XF86XK_LaunchA },
320  { Qt::Key_LaunchD, XF86XK_LaunchB },
321  { Qt::Key_LaunchE, XF86XK_LaunchC },
322  { Qt::Key_LaunchF, XF86XK_LaunchD },
323  { Qt::Key_MonBrightnessUp, XF86XK_MonBrightnessUp },
324  { Qt::Key_MonBrightnessDown, XF86XK_MonBrightnessDown },
325  { Qt::Key_KeyboardLightOnOff, XF86XK_KbdLightOnOff },
326  { Qt::Key_KeyboardBrightnessUp, XF86XK_KbdBrightnessUp },
327  { Qt::Key_KeyboardBrightnessDown, XF86XK_KbdBrightnessDown },
328 #endif
329 };
330 #endif //Q_WS_X11
331 
332 //---------------------------------------------------------------------
333 // Initialization
334 //---------------------------------------------------------------------
335 static bool g_bInitializedMods, g_bInitializedVariations, g_bInitializedKKeyLabels;
336 static bool g_bMacLabels;
337 #ifdef Q_WS_X11
338 static uint g_modXNumLock, g_modXScrollLock, g_modXModeSwitch;
339 
340 bool initializeMods()
341 {
342  XModifierKeymap* xmk = XGetModifierMapping( tqt_xdisplay() );
343 
344  g_rgModInfo[3].modX = g_modXNumLock = g_modXScrollLock = g_modXModeSwitch = 0;
345 
346  int min_keycode, max_keycode;
347  int keysyms_per_keycode = 0;
348  XDisplayKeycodes( tqt_xdisplay(), &min_keycode, &max_keycode );
349  XFree( XGetKeyboardMapping( tqt_xdisplay(), min_keycode, 1, &keysyms_per_keycode ));
350  // Qt assumes that Alt is always Mod1Mask, so start at Mod2Mask.
351  for( int i = Mod2MapIndex; i < 8; i++ ) {
352  uint mask = (1 << i);
353  uint keySymX = NoSymbol;
354  // This used to be only XkbKeycodeToKeysym( ... , 0, 0 ), but that fails with XFree4.3.99
355  // and X.org R6.7 , where for some reason only ( ... , 0, 1 ) works. I have absolutely no
356  // idea what the problem is, but searching all posibilities until something valid is
357  // found fixes the problem.
358  for( int j = 0; j < xmk->max_keypermod && keySymX == NoSymbol; ++j )
359  for( int k = 0; k < keysyms_per_keycode && keySymX == NoSymbol; ++k )
360  keySymX = XkbKeycodeToKeysym( tqt_xdisplay(), xmk->modifiermap[xmk->max_keypermod * i + j], 0, k );
361  switch( keySymX ) {
362  case XK_Num_Lock: g_modXNumLock = mask; break; // Normally Mod2Mask
363  case XK_Super_L:
364  case XK_Super_R: g_rgModInfo[3].modX = mask; break; // Win key, Normally Mod4Mask
365  case XK_Meta_L:
366  case XK_Meta_R: if( !g_rgModInfo[3].modX ) g_rgModInfo[3].modX = mask; break; // Win alternate
367  case XK_Scroll_Lock: g_modXScrollLock = mask; break; // Normally Mod5Mask
368  case XK_Mode_switch: g_modXModeSwitch = mask; break;
369  }
370  }
371 
372  XFreeModifiermap( xmk );
373 
374  //TDEConfigGroupSaver cgs( TDEGlobal::config(), "Keyboard" );
375  // read in mod that win should be attached to
376 
377  g_bInitializedMods = true;
378 
379  kdDebug(125) << "KKeyServer::initializeMods(): Win Mod = 0x" << TQString::number(g_rgModInfo[3].modX, 16) << endl;
380  return true;
381 }
382 
383 static void initializeVariations()
384 {
385  for( int i = 0; g_rgSymVariation[i].sym != 0; i++ )
386  g_rgSymVariation[i].bActive = (XKeysymToKeycode( tqt_xdisplay(), g_rgSymVariation[i].symVariation ) != 0);
387  g_bInitializedVariations = true;
388 }
389 #endif //Q_WS_X11
390 
391 static void intializeKKeyLabels()
392 {
393  TDEConfigGroupSaver cgs( TDEGlobal::config(), "Keyboard" );
394  g_rgModInfo[0].sLabel = TDEGlobal::config()->readEntry( "Label Shift", i18n(g_rgModInfo[0].psName) );
395  g_rgModInfo[1].sLabel = TDEGlobal::config()->readEntry( "Label Ctrl", i18n(g_rgModInfo[1].psName) );
396  g_rgModInfo[2].sLabel = TDEGlobal::config()->readEntry( "Label Alt", i18n(g_rgModInfo[2].psName) );
397  g_rgModInfo[3].sLabel = TDEGlobal::config()->readEntry( "Label Win", i18n(g_rgModInfo[3].psName) );
398  g_bMacLabels = (g_rgModInfo[2].sLabel == "Command");
399  g_bInitializedKKeyLabels = true;
400 }
401 
402 //---------------------------------------------------------------------
403 // class Mod
404 //---------------------------------------------------------------------
405 
406 /*void Mod::init( const TQString& s )
407 {
408 
409 }*/
410 
411 //---------------------------------------------------------------------
412 // class Sym
413 //---------------------------------------------------------------------
414 
415 bool Sym::initQt( int keyQt )
416 {
417  int symQt = keyQt & 0xffff;
418 
419  if( (keyQt & Qt::UNICODE_ACCEL) || symQt < 0x1000 ) {
420  m_sym = TQChar(symQt).lower().unicode();
421  return true;
422  }
423 
424 #ifdef Q_WS_WIN
425  m_sym = symQt;
426  return true;
427 #elif defined(Q_WS_X11)
428  for( uint i = 0; i < sizeof(g_rgQtToSymX)/sizeof(TransKey); i++ ) {
429  if( g_rgQtToSymX[i].keySymQt == symQt ) {
430  m_sym = g_rgQtToSymX[i].keySymX;
431  return true;
432  }
433  }
434 
435  m_sym = 0;
436  if( symQt != Qt::Key_Shift && symQt != Qt::Key_Control && symQt != Qt::Key_Alt &&
437  symQt != Qt::Key_Meta && symQt != Qt::Key_Direction_L && symQt != Qt::Key_Direction_R )
438  kdDebug(125) << "Sym::initQt( " << TQString::number(keyQt,16) << " ): failed to convert key." << endl;
439  return false;
440 #elif defined(Q_WS_MACX)
441  m_sym = symQt;
442  return true;
443 #endif
444 }
445 
446 bool Sym::init( const TQString& s )
447 {
448  // If it's a single character, get unicode value.
449  if( s.length() == 1 ) {
450  m_sym = s[0].lower().unicode();
451  return true;
452  }
453 
454  // Look up in special names list
455  for( int i = 0; g_rgSymNames[i].sym != 0; i++ ) {
456  if( tqstricmp( s.latin1(), g_rgSymNames[i].psName ) == 0 ) {
457  m_sym = g_rgSymNames[i].sym;
458  return true;
459  }
460  }
461 
462 #ifdef Q_WS_WIN
463  // search for name in KKeys array
464  for ( KKeys const *pKey = kde_KKEYS; pKey->code != 0xffff; pKey++) {
465  if( tqstricmp( s.latin1(), pKey->name ) == 0 ) {
466  m_sym = pKey->code;
467  return true;
468  }
469  }
470  m_sym = 0;
471 #elif defined(Q_WS_X11)
472  // search X list: 's' as is, all lower, first letter in caps
473  m_sym = XStringToKeysym( s.latin1() );
474  if( !m_sym ) {
475  m_sym = XStringToKeysym( s.lower().latin1() );
476  if( !m_sym ) {
477  TQString s2 = s;
478  s2[0] = s2[0].upper();
479  m_sym = XStringToKeysym( s2.latin1() );
480  }
481  }
482 #endif
483  return m_sym != 0;
484 }
485 
486 int Sym::qt() const
487 {
488  if( m_sym < 0x1000 ) {
489  if( m_sym >= 'a' && m_sym <= 'z' )
490  return TQChar(m_sym).upper();
491  return m_sym;
492  }
493 #ifdef Q_WS_WIN
494  if( m_sym < 0x3000 )
495  return m_sym;
496 #elif defined(Q_WS_X11)
497  if( m_sym < 0x3000 )
498  return m_sym | Qt::UNICODE_ACCEL;
499 
500  for( uint i = 0; i < sizeof(g_rgQtToSymX)/sizeof(TransKey); i++ )
501  if( g_rgQtToSymX[i].keySymX == m_sym )
502  return g_rgQtToSymX[i].keySymQt;
503 #endif
504  return TQt::Key_unknown;
505 }
506 
507 TQString Sym::toString( bool bUserSpace ) const
508 {
509  if( m_sym == 0 ) {
510  return TQString::null;
511  }
512 
513  // If it's a unicode character,
514 #ifdef Q_WS_WIN
515  else if( m_sym < 0x1000 ) {
516 #else
517  else if( m_sym < 0x3000 ) {
518 #endif
519  TQChar c = TQChar(m_sym).upper();
520  // Print all non-space characters directly when output is user-visible.
521  // Otherwise only print alphanumeric latin1 characters directly (A,B,C,1,2,3).
522  if( (c.latin1() && c.isLetterOrNumber())
523  || (bUserSpace && !c.isSpace()) ) {
524  return c;
525  }
526  }
527 
528  // Look up in special names list
529  for( int i = 0; g_rgSymNames[i].sym != 0; i++ ) {
530  if( m_sym == g_rgSymNames[i].sym ) {
531  return bUserSpace ? i18n(g_rgSymNames[i].psName) : TQString(g_rgSymNames[i].psName);
532  }
533  }
534 
535  TQString s;
536 #ifdef Q_WS_WIN
537  s = TQKeySequence( m_sym );
538 #elif defined(Q_WS_X11)
539  // Get X-name
540  s = XKeysymToString( m_sym );
541 #endif
542  capitalizeKeyname( s );
543  return bUserSpace ? i18n("TQAccel", s.latin1()) : s;
544 }
545 
546 TQString Sym::toStringInternal() const { return toString( false ); }
547 TQString Sym::toString() const { return toString( true ); }
548 
549 uint Sym::getModsRequired() const
550 {
551  uint mod = 0;
552 #ifdef Q_WS_X11
553  // FIXME: This might not be true on all keyboard layouts!
554  if( m_sym == XK_Sys_Req ) return KKey::ALT;
555  if( m_sym == XK_Break ) return KKey::CTRL;
556 
557  if( m_sym < 0x3000 ) {
558  TQChar c(m_sym);
559  if( c.isLetter() && c.lower() != c.upper() && m_sym == c.upper().unicode() )
560  return KKey::SHIFT;
561  }
562 
563  uchar code = XKeysymToKeycode( tqt_xdisplay(), m_sym );
564  if( code ) {
565  // need to check index 0 before the others, so that a null-mod
566  // can take precedence over the others, in case the modified
567  // key produces the same symbol.
568  if( m_sym == XkbKeycodeToKeysym( tqt_xdisplay(), code, 0, 0 ) )
569  ;
570  else if( m_sym == XkbKeycodeToKeysym( tqt_xdisplay(), code, 0, 1 ) )
571  mod = KKey::SHIFT;
572  else if( m_sym == XkbKeycodeToKeysym( tqt_xdisplay(), code, 0, 2 ) )
573  mod = KKeyServer::MODE_SWITCH;
574  else if( m_sym == XkbKeycodeToKeysym( tqt_xdisplay(), code, 0, 3 ) )
575  mod = KKey::SHIFT | KKeyServer::MODE_SWITCH;
576  }
577 #endif
578  return mod;
579 }
580 
581 uint Sym::getSymVariation() const
582 {
583 #ifdef Q_WS_X11
584  if( !g_bInitializedVariations )
585  initializeVariations();
586  for( int i = 0; g_rgSymVariation[i].sym != 0; i++ )
587  if( g_rgSymVariation[i].sym == m_sym && g_rgSymVariation[i].bActive )
588  return g_rgSymVariation[i].symVariation;
589 #endif
590  return 0;
591 }
592 
593 void Sym::capitalizeKeyname( TQString& s )
594 {
595  s[0] = s[0].upper();
596  int len = s.length();
597  if( s.endsWith( "left" ) ) s[len-4] = 'L';
598  else if( s.endsWith( "right" ) ) s[len-5] = 'R';
599  else if( s == "Sysreq" ) s[len-3] = 'R';
600 }
601 
602 //---------------------------------------------------------------------
603 // Public functions
604 //---------------------------------------------------------------------
605 
606 #ifdef Q_WS_X11
607 uint modX( KKey::ModFlag mod )
608 {
609  if( mod == KKey::WIN && !g_bInitializedMods )
610  initializeMods();
611 
612  for( uint i = 0; i < KKey::MOD_FLAG_COUNT; i++ ) {
613  if( g_rgModInfo[i].mod == mod )
614  return g_rgModInfo[i].modX;
615  }
616  return 0;
617 }
618 
619 bool keyboardHasWinKey() { if( !g_bInitializedMods ) { initializeMods(); } return g_rgModInfo[3].modX != 0; }
620 uint modXShift() { return ShiftMask; }
621 uint modXLock() { return LockMask; }
622 uint modXCtrl() { return ControlMask; }
623 uint modXAlt() { return Mod1Mask; }
624 uint modXNumLock() { if( !g_bInitializedMods ) { initializeMods(); } return g_modXNumLock; }
625 uint modXWin() { if( !g_bInitializedMods ) { initializeMods(); } return g_rgModInfo[3].modX; }
626 uint modXScrollLock() { if( !g_bInitializedMods ) { initializeMods(); } return g_modXScrollLock; }
627 uint modXModeSwitch() { if( !g_bInitializedMods ) { initializeMods(); } return g_modXModeSwitch; }
628 
629 uint accelModMaskX()
630 {
631  if( !g_bInitializedMods )
632  initializeMods();
633  return ShiftMask | ControlMask | Mod1Mask | g_rgModInfo[3].modX;
634 }
635 #endif //Q_WS_X11
636 
637 bool keyQtToSym( int keyQt, uint& keySym )
638 {
639  Sym sym;
640  if( sym.initQt( keyQt ) ) {
641  keySym = sym.m_sym;
642  return true;
643  } else
644  return false;
645 }
646 
647 bool keyQtToMod( int keyQt, uint& mod )
648 {
649  mod = 0;
650 
651  if( keyQt & Qt::SHIFT ) mod |= KKey::SHIFT;
652  if( keyQt & Qt::CTRL ) mod |= KKey::CTRL;
653  if( keyQt & Qt::ALT ) mod |= KKey::ALT;
654  if( keyQt & Qt::META ) mod |= KKey::WIN;
655 
656  return true;
657 }
658 
659 bool symToKeyQt( uint keySym, int& keyQt )
660 {
661  Sym sym( keySym );
662  keyQt = sym.qt();
663  return (keyQt != TQt::Key_unknown);
664 }
665 
666 bool modToModQt( uint mod, int& modQt )
667 {
668  modQt = 0;
669  for( int i = 0; i < KKey::MOD_FLAG_COUNT; i++ ) {
670  if( mod & g_rgModInfo[i].mod ) {
671  if( !g_rgModInfo[i].modQt ) {
672  modQt = 0;
673  return false;
674  }
675  modQt |= g_rgModInfo[i].modQt;
676  }
677  }
678  return true;
679 }
680 
681 #ifdef Q_WS_WIN
682 //wrapped
683 bool modXToModQt( uint modX, int& modQt )
684 {
685  return modToModQt( modX, modQt );
686 }
687 
688 TDECORE_EXPORT int qtButtonStateToMod( TQt::ButtonState s )
689 {
690  int modQt = 0;
691  if (s & Qt::ShiftButton) modQt |= KKey::SHIFT;
692  if (s & Qt::ControlButton) modQt |= KKey::CTRL;
693  if (s & Qt::AltButton) modQt |= KKey::ALT;
694  return modQt;
695 }
696 
697 bool keyboardHasWinKey() {
699  return true;
700 }
701 
702 #elif defined(Q_WS_MACX)
703 
704 bool modXToModQt(uint modX, int& modQt)
705 {
706  return modToModQt( modX, modQt );
707 }
708 
709 bool keyboardHasWinKey() {
711  return false;
712 }
713 
714 bool modXToMod( uint , uint& )
715 {
716  return false;
717 }
718 #elif defined(Q_WS_X11)
719 
720 bool modToModX( uint mod, uint& modX )
721 {
722  if( !g_bInitializedMods )
723  initializeMods();
724 
725  modX = 0;
726  for( int i = 0; i < KKey::MOD_FLAG_COUNT; i++ ) {
727  if( mod & g_rgModInfo[i].mod ) {
728  if( !g_rgModInfo[i].modX ) {
729  kdDebug(125) << "Invalid modifier flag." << endl;
730  modX = 0;
731  return false;
732  }
733  modX |= g_rgModInfo[i].modX;
734  }
735  }
736  // TODO: document 0x2000 flag
737  if( mod & 0x2000 )
738  modX |= 0x2000;
739  return true;
740 }
741 
742 bool modXToModQt( uint modX, int& modQt )
743 {
744  if( !g_bInitializedMods )
745  initializeMods();
746 
747  modQt = 0;
748  for( int i = 0; i < KKey::MOD_FLAG_COUNT; i++ ) {
749  if( modX & g_rgModInfo[i].modX ) {
750  if( !g_rgModInfo[i].modQt ) {
751  modQt = 0;
752  return false;
753  }
754  modQt |= g_rgModInfo[i].modQt;
755  }
756  }
757  return true;
758 }
759 
760 bool modXToMod( uint modX, uint& mod )
761 {
762  if( !g_bInitializedMods )
763  initializeMods();
764 
765  mod = 0;
766  for( int i = 0; i < KKey::MOD_FLAG_COUNT; i++ ) {
767  if( modX & g_rgModInfo[i].modX )
768  mod |= g_rgModInfo[i].mod;
769  }
770  return true;
771 }
772 
773 bool codeXToSym( uchar codeX, uint modX, uint& sym )
774 {
775  KeySym keySym;
776  XKeyPressedEvent event;
777 
778  event.type = KeyPress;
779  event.display = tqt_xdisplay();
780  event.state = modX;
781  event.keycode = codeX;
782 
783  char buffer[64];
784  XLookupString( &event, buffer, 63, &keySym, NULL );
785  sym = (uint) keySym;
786  return true;
787 }
788 #endif
789 
790 static TQString modToString( uint mod, bool bUserSpace )
791 {
792  if( bUserSpace && !g_bInitializedKKeyLabels )
793  intializeKKeyLabels();
794 
795  TQString s;
796  for( int i = KKey::MOD_FLAG_COUNT-1; i >= 0; i-- ) {
797  if( mod & g_rgModInfo[i].mod ) {
798  if( !s.isEmpty() )
799  s += '+';
800  s += (bUserSpace)
801  ? g_rgModInfo[i].sLabel
802  : TQString(g_rgModInfo[i].psName);
803  }
804  }
805  return s;
806 }
807 
808 TQString modToStringInternal( uint mod ) { return modToString( mod, false ); }
809 TQString modToStringUser( uint mod ) { return modToString( mod, true ); }
810 
811 uint stringUserToMod( const TQString& mod )
812 {
813  if( !g_bInitializedKKeyLabels )
814  intializeKKeyLabels();
815 
816  TQString s;
817  for( int i = KKey::MOD_FLAG_COUNT-1; i >= 0; i-- ) {
818  if( mod.lower() == g_rgModInfo[i].sLabel.lower())
819  return g_rgModInfo[i].mod;
820  }
821  return 0;
822 }
823 
824 /*void keySymModToKeyX( uint sym, uint mod, unsigned char *pKeyCodeX, uint *pKeySymX, uint *pKeyModX )
825 {
826 ...
827  uint keySymQt;
828  uint keySymX = 0;
829  unsigned char keyCodeX = 0;
830  uint keyModX = 0;
831 
832  const char *psKeySym = 0;
833 
834  if( !g_bInitialized )
835  Initialize();
836 
837  // Get code of just the primary key
838  keySymQt = keyCombQt & 0xffff;
839 
840  // If unicode value beneath 0x1000 (special Qt codes begin thereafter),
841  if( keySymQt < 0x1000 ) {
842  // For reasons unbeknownst to me, Qt converts 'a-z' to 'A-Z'.
843  // So convert it back to lowercase if SHIFT isn't held down.
844  if( keySymQt >= Qt::Key_A && keySymQt <= Qt::Key_Z && !(keyCombQt & Qt::SHIFT) )
845  keySymQt = tolower( keySymQt );
846  keySymX = keySymQt;
847  }
848  // Else, special key (e.g. Delete, F1, etc.)
849  else {
850  for( int i = 0; i < NB_KEYS; i++ ) {
851  if( keySymQt == (uint) KKEYS[i].code ) {
852  psKeySym = KKEYS[i].name;
853  //kdDebug(125) << " symbol found: \"" << psKeySym << "\"" << endl;
854  break;
855  }
856  }
857 
858  // Get X key symbol. Only works if Qt name is same as X name.
859  if( psKeySym ) {
860  TQString sKeySym = psKeySym;
861 
862  // Check for lower-case equalent first because most
863  // X11 names are all lower-case.
864  keySymX = XStringToKeysym( sKeySym.lower().ascii() );
865  if( keySymX == 0 )
866  keySymX = XStringToKeysym( psKeySym );
867  }
868 
869  if( keySymX == 0 )
870  keySymX = getSymXEquiv( keySymQt );
871  }
872 
873  if( keySymX != 0 ) {
874  // Get X keyboard code
875  keyCodeX = XKeysymToKeycode( tqt_xdisplay(), keySymX );
876  // Add ModeSwitch modifier bit, if necessary
877  keySymXMods( keySymX, 0, &keyModX );
878 
879  // Get X modifier flags
880  for( int i = 0; i < MOD_KEYS; i++ ) {
881  if( keyCombQt & g_aModKeys[i].keyModMaskQt ) {
882  if( g_aModKeys[i].keyModMaskX )
883  keyModX |= g_aModKeys[i].keyModMaskX;
884  // Qt key calls for a modifier which the current
885  // X modifier map doesn't support.
886  else {
887  keySymX = 0;
888  keyCodeX = 0;
889  keyModX = 0;
890  break;
891  }
892  }
893  }
894  }
895 
896  // Take care of complications:
897  // The following keys will not have been correctly interpreted,
898  // because their shifted values are not activated with the
899  // Shift key, but rather something else. They are also
900  // defined twice under different keycodes.
901  // keycode 111 & 92: Print Sys_Req -> Sys_Req = Alt+Print
902  // keycode 110 & 114: Pause Break -> Break = Ctrl+Pause
903  if( (keyCodeX == 92 || keyCodeX == 111) &&
904  XkbKeycodeToKeysym( tqt_xdisplay(), 92, 0, 0 ) == XK_Print &&
905  XkbKeycodeToKeysym( tqt_xdisplay(), 111, 0, 0 ) == XK_Print )
906  {
907  // If Alt is pressed, then we need keycode 92, keysym XK_Sys_Req
908  if( keyModX & keyModXAlt() ) {
909  keyCodeX = 92;
910  keySymX = XK_Sys_Req;
911  }
912  // Otherwise, keycode 111, keysym XK_Print
913  else {
914  keyCodeX = 111;
915  keySymX = XK_Print;
916  }
917  }
918  else if( (keyCodeX == 110 || keyCodeX == 114) &&
919  XkbKeycodeToKeysym( tqt_xdisplay(), 110, 0, 0 ) == XK_Pause &&
920  XkbKeycodeToKeysym( tqt_xdisplay(), 114, 0, 0 ) == XK_Pause )
921  {
922  if( keyModX & keyModXCtrl() ) {
923  keyCodeX = 114;
924  keySymX = XK_Break;
925  } else {
926  keyCodeX = 110;
927  keySymX = XK_Pause;
928  }
929  }
930 
931  if( pKeySymX ) *pKeySymX = keySymX;
932  if( pKeyCodeX ) *pKeyCodeX = keyCodeX;
933  if( pKeyModX ) *pKeyModX = keyModX;
934 }*/
935 
936 //---------------------------------------------------------------------
937 // Key
938 //---------------------------------------------------------------------
939 
940 bool Key::init( const KKey& key, bool bQt )
941 {
942  if( bQt ) {
943  m_code = CODE_FOR_QT;
944  m_sym = key.keyCodeQt();
945  } else {
946  KKeyNative keyNative( key );
947  *this = keyNative;
948  }
949  return true;
950 }
951 
952 KKey Key::key() const
953 {
954  if( m_code == CODE_FOR_QT )
955  return KKey( keyCodeQt() );
956  else {
957 #if defined(Q_WS_WIN) || defined(Q_WS_MACX)
958  return KKey();
959 #else
960  uint mod;
961  modXToMod( m_mod, mod );
962  return KKey( m_sym, mod );
963 #endif
964  }
965 }
966 
967 Key& Key::operator =( const KKeyNative& key )
968 {
969  m_code = key.code(); m_mod = key.mod(); m_sym = key.sym();
970  return *this;
971 }
972 
973 int Key::compare( const Key& b ) const
974 {
975  if( m_code == CODE_FOR_QT )
976  return m_sym - b.m_sym;
977  if( m_sym != b.m_sym ) return m_sym - b.m_sym;
978  if( m_mod != b.m_mod ) return m_mod - b.m_mod;
979  return m_code - b.m_code;
980 }
981 
982 //---------------------------------------------------------------------
983 // Variations
984 //---------------------------------------------------------------------
985 
986 // TODO: allow for sym to have variations, such as Plus => { Plus, KP_Add }
987 void Variations::init( const KKey& key, bool bQt )
988 {
989  if( key.isNull() ) {
990  m_nVariations = 0;
991  return;
992  }
993 
994  m_nVariations = 1;
995  m_rgkey[0] = KKeyNative(key);
996  uint symVar = Sym(key.sym()).getSymVariation();
997  if( symVar ) {
998  uint modReq = Sym(m_rgkey[0].sym()).getModsRequired();
999  uint modReqVar = Sym(symVar).getModsRequired();
1000  // If 'key' doesn't require any mods that are inherent in
1001  // the primary key but not required for the alternate,
1002  if( (key.modFlags() & modReq) == (key.modFlags() & modReqVar) ) {
1003  m_rgkey[1] = KKeyNative(KKey(symVar, key.modFlags()));
1004  m_nVariations = 2;
1005  }
1006  }
1007 
1008  if( bQt ) {
1009  uint nVariations = 0;
1010  for( uint i = 0; i < m_nVariations; i++ ) {
1011  int keyQt = KKeyNative( m_rgkey[i].code(), m_rgkey[i].mod(), m_rgkey[i].sym() ).keyCodeQt();
1012  if( keyQt ) {
1013  m_rgkey[nVariations++].setKeycodeQt( keyQt );
1014  }
1015  }
1016  m_nVariations = nVariations;
1017 
1018  // Two different native codes may produce a single
1019  // Qt code. Search for duplicates.
1020  for( uint i = 1; i < m_nVariations; i++ ) {
1021  for( uint j = 0; j < i; j++ ) {
1022  // If key is already present in list, then remove it.
1023  if( m_rgkey[i].keyCodeQt() == m_rgkey[j].keyCodeQt() ) {
1024  for( uint k = i; k < m_nVariations - 1; k++ ) {
1025  m_rgkey[k].setKeycodeQt( m_rgkey[k+1].keyCodeQt() );
1026  }
1027  m_nVariations--;
1028  i--;
1029  break;
1030  }
1031  }
1032  }
1033  }
1034 }
1035 
1036 } // end of namespace KKeyServer block
1037 
1038 // FIXME: This needs to be moved to tdeshortcut.cpp, and create a
1039 // KKeyServer::method which it will call.
1040 // Alt+SysReq => Alt+Print
1041 // Ctrl+Shift+Plus => Ctrl+Plus (en)
1042 // Ctrl+Shift+Equal => Ctrl+Plus
1043 // Ctrl+Pause => Ctrl+Break
1044 void KKey::simplify()
1045 {
1046 #ifdef Q_WS_X11
1047  if( m_sym == XK_Sys_Req ) {
1048  m_sym = XK_Print;
1049  m_mod |= ALT;
1050  } else if( m_sym == XK_ISO_Left_Tab ) {
1051  m_sym = XK_Tab;
1052  m_mod |= SHIFT;
1053  } else {
1054  // Shift+Equal => Shift+Plus (en)
1055  m_sym = KKeyNative(*this).sym();
1056  }
1057 
1058  // If this is a letter, don't remove any modifiers.
1059  if( m_sym < 0x3000 && TQChar(m_sym).isLetter() ) {
1060  m_sym = TQChar(m_sym).lower().unicode();
1061  }
1062 
1063  // Remove modifers from modifier list which are implicit in the symbol.
1064  // Ex. Shift+Plus => Plus (en)
1065  m_mod &= ~KKeyServer::Sym(m_sym).getModsRequired();
1066 #endif
1067 }
1068 
1069 #endif //Q_WS_X11 || Q_WS_WIN
1070 
KKey::ModFlag
ModFlag
Flags to represent the modifiers.
Definition: tdeshortcut.h:53
KNotifyClient::event
int event(const TQString &message, const TQString &text=TQString::null) KDE_DEPRECATED
Definition: knotifyclient.cpp:125
KKeyServer::codeXToSym
bool codeXToSym(uchar codeX, uint modX, uint &symX)
Converts a X11 key code and a mask of ORed X11 modifiers into a X11 symbol.
KKeyServer::Key::key
KKey key() const
Converts this Key to a KKey.
KKeyServer::Key::operator=
Key & operator=(const KKeyNative &key)
Initializes this key with a KKeyNative.
TDEConfigGroupSaver
Helper class to facilitate working with TDEConfig / KSimpleConfig groups.
Definition: tdeconfigbase.h:2082
KKeyServer::Sym::getModsRequired
uint getModsRequired() const
Returns the mods that are required for this symbol as ORed KKey::ModFlag's.
KKeyServer
A collection of functions for the conversion of key presses and their modifiers from the window syste...
Definition: kkeyserver_x11.h:34
KKeyServer::symToKeyQt
bool symToKeyQt(uint sym, int &keyQt)
Converts the given symbol to a Qt key code.
KKeyServer::modXNumLock
uint modXNumLock()
Returns the X11 NumLock modifier mask/flag.
KKeyServer::modXScrollLock
uint modXScrollLock()
Returns the X11 ScrollLock modifier mask/flag.
KKeyServer::modXAlt
uint modXAlt()
Returns the X11 Alt (Mod1) modifier mask/flag.
KKeyServer::modXModeSwitch
uint modXModeSwitch()
Returns the X11 Mode_switch modifier mask/flag.
KKeyServer::modXShift
uint modXShift()
Returns the X11 Shift modifier mask/flag.
KKeyServer::Sym::toString
TQString toString() const
Returns the string representation of the symbol.
KKey::isNull
bool isNull() const
Returns true if the key is null (after clear() or empty constructor).
Definition: tdeshortcut.cpp:149
KKeyServer::keyboardHasWinKey
bool keyboardHasWinKey()
Returns true if the current keyboard layout supports the Win key.
KKeyServer::Sym::init
bool init(const TQString &s)
Initializes the key with the given string description.
KKeyServer::keyQtToMod
bool keyQtToMod(int keyQt, uint &mod)
Extracts the modifiers from the given Qt key and converts them in a mask of ORed KKey::ModFlag modifi...
KKeyNative::keyCodeQt
int keyCodeQt() const
Returns the qt key code.
tdelocale.h
KKeyNative::mod
uint mod() const
The native modifier flags of the key.
KKeyServer::Sym::m_sym
uint m_sym
the actual value of the symbol
Definition: kkeyserver_x11.h:51
KKeyServer::initializeMods
bool initializeMods()
TODO: please document.
KKeyNative::code
uint code() const
The native keycode of the key.
KKeyServer::modToModQt
bool modToModQt(uint mod, int &modQt)
Converts the mask of ORed KKey::ModFlag modifiers to a mask of ORed Qt key code modifiers.
KKeyServer::modX
uint modX(KKey::ModFlag modFlag)
Returns the equivalent X modifier mask of the given modifier flag.
KKeyServer::modXToMod
bool modXToMod(uint modX, uint &mod)
Converts the mask of ORed X11 modifiers to a mask of ORed KKey::ModFlag modifiers.
KKeyServer::modXWin
uint modXWin()
Returns the X11 Win (Mod3) modifier mask/flag.
KKeyServer::Sym::qt
int qt() const
Returns the qt key code of the symbol.
KKeyServer::modXLock
uint modXLock()
Returns the X11 Lock modifier mask/flag.
KKeyServer::Sym::Sym
Sym()
Creates a null symbol.
Definition: kkeyserver_x11.h:54
KKeyServer::qtButtonStateToMod
int qtButtonStateToMod(TQ_ButtonState s)
Converts the Qt-compatible button state to x11 modifier.
KKeyServer::modToModX
bool modToModX(uint mod, uint &modX)
Converts the mask of ORed KKey::ModFlag modifiers to a mask of ORed X11 modifiers.
KKeyNative
Representation of a key in the format native of the windowing system (eg.
Definition: kkeynative.h:37
KKeyServer::Sym::initQt
bool initQt(int keyQt)
Initializes the symbol with the given Qt key code.
KKeyServer::Key::init
bool init(const KKey &key, bool bQt)
Initializes the key with a KKey.
KKeyServer::stringUserToMod
uint stringUserToMod(const TQString &mod)
Converts the modifier given as user-readable string to KKey::ModFlag modifier, or 0...
KKeyServer::modToStringUser
TQString modToStringUser(uint mod)
Converts the mask of ORed KKey::ModFlag modifiers to a user-readable string.
KKey
A KKey object represents a single key with possible modifiers (Shift, Ctrl, Alt, Win).
Definition: tdeshortcut.h:40
KKey::keyCodeQt
int keyCodeQt() const
Returns the qt key code.
Definition: tdeshortcut.cpp:162
KKeyServer::modXToModQt
bool modXToModQt(uint modX, int &modQt)
Converts the mask of ORed X11 modifiers to a mask of ORed Qt key code modifiers.
KKeyServer::modXCtrl
uint modXCtrl()
Returns the X11 Ctrl modifier mask/flag.
TDEGlobal::config
static TDEConfig * config()
Returns the general config object.
Definition: tdeglobal.cpp:65
endl
kndbgstream & endl(kndbgstream &s)
Does nothing.
Definition: kdebug.h:583
KKeyNative::sym
uint sym() const
The native symbol (KeySym) of the key.
TDEConfigBase::readEntry
TQString readEntry(const TQString &pKey, const TQString &aDefault=TQString::null) const
Reads the value of an entry specified by pKey in the current group.
Definition: tdeconfigbase.cpp:221
KKeyServer::Sym::getSymVariation
uint getSymVariation() const
TODO: please find out what this method does and document it.
KKeyServer::Key::compare
int compare(const Key &key) const
Compares this key with the given Key object.
KKeyServer::accelModMaskX
uint accelModMaskX()
Returns bitwise OR'ed mask containing Shift, Ctrl, Alt, and Win (if available).
KKeyServer::keyQtToSym
bool keyQtToSym(int keyQt, uint &sym)
Extracts the symbol from the given Qt key and converts it to a symbol.

tdecore

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

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.8.8
This website is maintained by Timothy Pearson.