diff options
Diffstat (limited to 'tdecore/kkeyserver_x11.cpp')
-rw-r--r-- | tdecore/kkeyserver_x11.cpp | 262 |
1 files changed, 131 insertions, 131 deletions
diff --git a/tdecore/kkeyserver_x11.cpp b/tdecore/kkeyserver_x11.cpp index bb46338f4..ebe06de97 100644 --- a/tdecore/kkeyserver_x11.cpp +++ b/tdecore/kkeyserver_x11.cpp @@ -48,14 +48,14 @@ #else # include <kckey.h> # define X11_ONLY(arg) -# define XK_ISO_Left_Tab Qt::Key_Backtab -# define XK_BackSpace Qt::Key_Backspace -# define XK_Sys_Req Qt::Key_SysReq -# define XK_Caps_Lock Qt::Key_CapsLock -# define XK_Num_Lock Qt::Key_NumLock -# define XK_Scroll_Lock Qt::Key_ScrollLock -# define XK_Prior Qt::Key_Prior -# define XK_Next Qt::Key_Next +# define XK_ISO_Left_Tab TQt::Key_Backtab +# define XK_BackSpace TQt::Key_Backspace +# define XK_Sys_Req TQt::Key_SysReq +# define XK_Caps_Lock TQt::Key_CapsLock +# define XK_Num_Lock TQt::Key_NumLock +# define XK_Scroll_Lock TQt::Key_ScrollLock +# define XK_Prior TQt::Key_Prior +# define XK_Next TQt::Key_Next #endif namespace KKeyServer @@ -108,9 +108,9 @@ struct TransKey { static ModInfo g_rgModInfo[KKey::MOD_FLAG_COUNT] = { - { KKey::SHIFT, Qt::SHIFT, X11_ONLY(ShiftMask) I18N_NOOP("Shift"), TQString() }, - { KKey::CTRL, Qt::CTRL, X11_ONLY(ControlMask) I18N_NOOP("Ctrl"), TQString() }, - { KKey::ALT, Qt::ALT, X11_ONLY(Mod1Mask) I18N_NOOP("Alt"), TQString() }, + { KKey::SHIFT, TQt::SHIFT, X11_ONLY(ShiftMask) I18N_NOOP("Shift"), TQString() }, + { KKey::CTRL, TQt::CTRL, X11_ONLY(ControlMask) I18N_NOOP("Ctrl"), TQString() }, + { KKey::ALT, TQt::ALT, X11_ONLY(Mod1Mask) I18N_NOOP("Alt"), TQString() }, { KKey::WIN, KKey::QtWIN, X11_ONLY(Mod4Mask) I18N_NOOP("Win"), TQString() } }; @@ -156,85 +156,85 @@ static SymVariation g_rgSymVariation[] = // These are the X equivalents to the Qt keycodes 0x1000 - 0x1026 static const TransKey g_rgQtToSymX[] = { - { Qt::Key_Escape, XK_Escape }, - { Qt::Key_Tab, XK_Tab }, - { Qt::Key_Backtab, XK_ISO_Left_Tab }, - { Qt::Key_Backspace, XK_BackSpace }, - { Qt::Key_Return, XK_Return }, - { Qt::Key_Enter, XK_KP_Enter }, - { Qt::Key_Insert, XK_Insert }, - { Qt::Key_Delete, XK_Delete }, - { Qt::Key_Pause, XK_Pause }, + { TQt::Key_Escape, XK_Escape }, + { TQt::Key_Tab, XK_Tab }, + { TQt::Key_Backtab, XK_ISO_Left_Tab }, + { TQt::Key_Backspace, XK_BackSpace }, + { TQt::Key_Return, XK_Return }, + { TQt::Key_Enter, XK_KP_Enter }, + { TQt::Key_Insert, XK_Insert }, + { TQt::Key_Delete, XK_Delete }, + { TQt::Key_Pause, XK_Pause }, #ifdef sun - { Qt::Key_Print, XK_F22 }, + { TQt::Key_Print, XK_F22 }, #else - { Qt::Key_Print, XK_Print }, + { TQt::Key_Print, XK_Print }, #endif - { Qt::Key_SysReq, XK_Sys_Req }, - { Qt::Key_Home, XK_Home }, - { Qt::Key_End, XK_End }, - { Qt::Key_Left, XK_Left }, - { Qt::Key_Up, XK_Up }, - { Qt::Key_Right, XK_Right }, - { Qt::Key_Down, XK_Down }, + { TQt::Key_SysReq, XK_Sys_Req }, + { TQt::Key_Home, XK_Home }, + { TQt::Key_End, XK_End }, + { TQt::Key_Left, XK_Left }, + { TQt::Key_Up, XK_Up }, + { TQt::Key_Right, XK_Right }, + { TQt::Key_Down, XK_Down }, { TQt::Key_Prior, XK_Prior }, { TQt::Key_Next, XK_Next }, - //{ Qt::Key_Shift, 0 }, - //{ Qt::Key_Control, 0 }, - //{ Qt::Key_Meta, 0 }, - //{ Qt::Key_Alt, 0 }, - { Qt::Key_CapsLock, XK_Caps_Lock }, - { Qt::Key_NumLock, XK_Num_Lock }, - { Qt::Key_ScrollLock, XK_Scroll_Lock }, - { Qt::Key_F1, XK_F1 }, - { Qt::Key_F2, XK_F2 }, - { Qt::Key_F3, XK_F3 }, - { Qt::Key_F4, XK_F4 }, - { Qt::Key_F5, XK_F5 }, - { Qt::Key_F6, XK_F6 }, - { Qt::Key_F7, XK_F7 }, - { Qt::Key_F8, XK_F8 }, - { Qt::Key_F9, XK_F9 }, - { Qt::Key_F10, XK_F10 }, - { Qt::Key_F11, XK_F11 }, - { Qt::Key_F12, XK_F12 }, - { Qt::Key_F13, XK_F13 }, - { Qt::Key_F14, XK_F14 }, - { Qt::Key_F15, XK_F15 }, - { Qt::Key_F16, XK_F16 }, - { Qt::Key_F17, XK_F17 }, - { Qt::Key_F18, XK_F18 }, - { Qt::Key_F19, XK_F19 }, - { Qt::Key_F20, XK_F20 }, - { Qt::Key_F21, XK_F21 }, - { Qt::Key_F22, XK_F22 }, - { Qt::Key_F23, XK_F23 }, - { Qt::Key_F24, XK_F24 }, - { Qt::Key_F25, XK_F25 }, - { Qt::Key_F26, XK_F26 }, - { Qt::Key_F27, XK_F27 }, - { Qt::Key_F28, XK_F28 }, - { Qt::Key_F29, XK_F29 }, - { Qt::Key_F30, XK_F30 }, - { Qt::Key_F31, XK_F31 }, - { Qt::Key_F32, XK_F32 }, - { Qt::Key_F33, XK_F33 }, - { Qt::Key_F34, XK_F34 }, - { Qt::Key_F35, XK_F35 }, - { Qt::Key_Super_L, XK_Super_L }, - { Qt::Key_Super_R, XK_Super_R }, - { Qt::Key_Menu, XK_Menu }, - { Qt::Key_Hyper_L, XK_Hyper_L }, - { Qt::Key_Hyper_R, XK_Hyper_R }, - { Qt::Key_Help, XK_Help }, - //{ Qt::Key_Direction_L, XK_Direction_L }, These keys don't exist in X11 - //{ Qt::Key_Direction_R, XK_Direction_R }, + //{ TQt::Key_Shift, 0 }, + //{ TQt::Key_Control, 0 }, + //{ TQt::Key_Meta, 0 }, + //{ TQt::Key_Alt, 0 }, + { TQt::Key_CapsLock, XK_Caps_Lock }, + { TQt::Key_NumLock, XK_Num_Lock }, + { TQt::Key_ScrollLock, XK_Scroll_Lock }, + { TQt::Key_F1, XK_F1 }, + { TQt::Key_F2, XK_F2 }, + { TQt::Key_F3, XK_F3 }, + { TQt::Key_F4, XK_F4 }, + { TQt::Key_F5, XK_F5 }, + { TQt::Key_F6, XK_F6 }, + { TQt::Key_F7, XK_F7 }, + { TQt::Key_F8, XK_F8 }, + { TQt::Key_F9, XK_F9 }, + { TQt::Key_F10, XK_F10 }, + { TQt::Key_F11, XK_F11 }, + { TQt::Key_F12, XK_F12 }, + { TQt::Key_F13, XK_F13 }, + { TQt::Key_F14, XK_F14 }, + { TQt::Key_F15, XK_F15 }, + { TQt::Key_F16, XK_F16 }, + { TQt::Key_F17, XK_F17 }, + { TQt::Key_F18, XK_F18 }, + { TQt::Key_F19, XK_F19 }, + { TQt::Key_F20, XK_F20 }, + { TQt::Key_F21, XK_F21 }, + { TQt::Key_F22, XK_F22 }, + { TQt::Key_F23, XK_F23 }, + { TQt::Key_F24, XK_F24 }, + { TQt::Key_F25, XK_F25 }, + { TQt::Key_F26, XK_F26 }, + { TQt::Key_F27, XK_F27 }, + { TQt::Key_F28, XK_F28 }, + { TQt::Key_F29, XK_F29 }, + { TQt::Key_F30, XK_F30 }, + { TQt::Key_F31, XK_F31 }, + { TQt::Key_F32, XK_F32 }, + { TQt::Key_F33, XK_F33 }, + { TQt::Key_F34, XK_F34 }, + { TQt::Key_F35, XK_F35 }, + { TQt::Key_Super_L, XK_Super_L }, + { TQt::Key_Super_R, XK_Super_R }, + { TQt::Key_Menu, XK_Menu }, + { TQt::Key_Hyper_L, XK_Hyper_L }, + { TQt::Key_Hyper_R, XK_Hyper_R }, + { TQt::Key_Help, XK_Help }, + //{ TQt::Key_Direction_L, XK_Direction_L }, These keys don't exist in X11 + //{ TQt::Key_Direction_R, XK_Direction_R }, { '/', XK_KP_Divide }, { '*', XK_KP_Multiply }, { '-', XK_KP_Subtract }, { '+', XK_KP_Add }, - { Qt::Key_Return, XK_KP_Enter } + { TQt::Key_Return, XK_KP_Enter } #if TQT_VERSION >= 0x030100 // the next lines are taken from XFree > 4.0 (X11/XF86keysyms.h), defining some special @@ -285,46 +285,46 @@ static const TransKey g_rgQtToSymX[] = #define XF86XK_KbdBrightnessDown 0x1008FF06 /* Keyboards may be lit */ // end of XF86keysyms.h , - { Qt::Key_Standby, XF86XK_Standby }, - { Qt::Key_VolumeDown, XF86XK_AudioLowerVolume }, - { Qt::Key_VolumeMute, XF86XK_AudioMute }, - { Qt::Key_VolumeUp, XF86XK_AudioRaiseVolume }, - { Qt::Key_MediaPlay, XF86XK_AudioPlay }, - { Qt::Key_MediaStop, XF86XK_AudioStop }, + { TQt::Key_Standby, XF86XK_Standby }, + { TQt::Key_VolumeDown, XF86XK_AudioLowerVolume }, + { TQt::Key_VolumeMute, XF86XK_AudioMute }, + { TQt::Key_VolumeUp, XF86XK_AudioRaiseVolume }, + { TQt::Key_MediaPlay, XF86XK_AudioPlay }, + { TQt::Key_MediaStop, XF86XK_AudioStop }, { TQt::Key_MediaPrev, XF86XK_AudioPrev }, - { Qt::Key_MediaNext, XF86XK_AudioNext }, - { Qt::Key_HomePage, XF86XK_HomePage }, - { Qt::Key_LaunchMail, XF86XK_Mail }, - { Qt::Key_Search, XF86XK_Search }, - { Qt::Key_MediaRecord, XF86XK_AudioRecord }, - { Qt::Key_LaunchMedia, XF86XK_AudioMedia }, - { Qt::Key_Launch1, XF86XK_Calculator }, - { Qt::Key_Back, XF86XK_Back }, - { Qt::Key_Forward, XF86XK_Forward }, - { Qt::Key_Stop, XF86XK_Stop }, - { Qt::Key_Refresh, XF86XK_Refresh }, - { Qt::Key_Favorites, XF86XK_Favorites }, - { Qt::Key_Launch0, XF86XK_MyComputer }, - { Qt::Key_OpenUrl, XF86XK_OpenURL }, - { Qt::Key_Launch2, XF86XK_Launch0 }, - { Qt::Key_Launch3, XF86XK_Launch1 }, - { Qt::Key_Launch4, XF86XK_Launch2 }, - { Qt::Key_Launch5, XF86XK_Launch3 }, - { Qt::Key_Launch6, XF86XK_Launch4 }, - { Qt::Key_Launch7, XF86XK_Launch5 }, - { Qt::Key_Launch8, XF86XK_Launch6 }, - { Qt::Key_Launch9, XF86XK_Launch7 }, - { Qt::Key_LaunchA, XF86XK_Launch8 }, - { Qt::Key_LaunchB, XF86XK_Launch9 }, - { Qt::Key_LaunchC, XF86XK_LaunchA }, - { Qt::Key_LaunchD, XF86XK_LaunchB }, - { Qt::Key_LaunchE, XF86XK_LaunchC }, - { Qt::Key_LaunchF, XF86XK_LaunchD }, - { Qt::Key_MonBrightnessUp, XF86XK_MonBrightnessUp }, - { Qt::Key_MonBrightnessDown, XF86XK_MonBrightnessDown }, - { Qt::Key_KeyboardLightOnOff, XF86XK_KbdLightOnOff }, - { Qt::Key_KeyboardBrightnessUp, XF86XK_KbdBrightnessUp }, - { Qt::Key_KeyboardBrightnessDown, XF86XK_KbdBrightnessDown }, + { TQt::Key_MediaNext, XF86XK_AudioNext }, + { TQt::Key_HomePage, XF86XK_HomePage }, + { TQt::Key_LaunchMail, XF86XK_Mail }, + { TQt::Key_Search, XF86XK_Search }, + { TQt::Key_MediaRecord, XF86XK_AudioRecord }, + { TQt::Key_LaunchMedia, XF86XK_AudioMedia }, + { TQt::Key_Launch1, XF86XK_Calculator }, + { TQt::Key_Back, XF86XK_Back }, + { TQt::Key_Forward, XF86XK_Forward }, + { TQt::Key_Stop, XF86XK_Stop }, + { TQt::Key_Refresh, XF86XK_Refresh }, + { TQt::Key_Favorites, XF86XK_Favorites }, + { TQt::Key_Launch0, XF86XK_MyComputer }, + { TQt::Key_OpenUrl, XF86XK_OpenURL }, + { TQt::Key_Launch2, XF86XK_Launch0 }, + { TQt::Key_Launch3, XF86XK_Launch1 }, + { TQt::Key_Launch4, XF86XK_Launch2 }, + { TQt::Key_Launch5, XF86XK_Launch3 }, + { TQt::Key_Launch6, XF86XK_Launch4 }, + { TQt::Key_Launch7, XF86XK_Launch5 }, + { TQt::Key_Launch8, XF86XK_Launch6 }, + { TQt::Key_Launch9, XF86XK_Launch7 }, + { TQt::Key_LaunchA, XF86XK_Launch8 }, + { TQt::Key_LaunchB, XF86XK_Launch9 }, + { TQt::Key_LaunchC, XF86XK_LaunchA }, + { TQt::Key_LaunchD, XF86XK_LaunchB }, + { TQt::Key_LaunchE, XF86XK_LaunchC }, + { TQt::Key_LaunchF, XF86XK_LaunchD }, + { TQt::Key_MonBrightnessUp, XF86XK_MonBrightnessUp }, + { TQt::Key_MonBrightnessDown, XF86XK_MonBrightnessDown }, + { TQt::Key_KeyboardLightOnOff, XF86XK_KbdLightOnOff }, + { TQt::Key_KeyboardBrightnessUp, XF86XK_KbdBrightnessUp }, + { TQt::Key_KeyboardBrightnessDown, XF86XK_KbdBrightnessDown }, #endif }; #endif //Q_WS_X11 @@ -416,7 +416,7 @@ bool Sym::initQt( int keyQt ) { int symQt = keyQt & 0xffff; - if( (keyQt & Qt::UNICODE_ACCEL) || symQt < 0x1000 ) { + if( (keyQt & TQt::UNICODE_ACCEL) || symQt < 0x1000 ) { m_sym = TQChar(symQt).lower().unicode(); return true; } @@ -433,8 +433,8 @@ bool Sym::initQt( int keyQt ) } m_sym = 0; - if( symQt != Qt::Key_Shift && symQt != Qt::Key_Control && symQt != Qt::Key_Alt && - symQt != Qt::Key_Meta && symQt != Qt::Key_Direction_L && symQt != Qt::Key_Direction_R ) + if( symQt != TQt::Key_Shift && symQt != TQt::Key_Control && symQt != TQt::Key_Alt && + symQt != TQt::Key_Meta && symQt != TQt::Key_Direction_L && symQt != TQt::Key_Direction_R ) kdDebug(125) << "Sym::initQt( " << TQString::number(keyQt,16) << " ): failed to convert key." << endl; return false; #elif defined(Q_WS_MACX) @@ -495,7 +495,7 @@ int Sym::qt() const return m_sym; #elif defined(Q_WS_X11) if( m_sym < 0x3000 ) - return m_sym | Qt::UNICODE_ACCEL; + return m_sym | TQt::UNICODE_ACCEL; for( uint i = 0; i < sizeof(g_rgQtToSymX)/sizeof(TransKey); i++ ) if( g_rgQtToSymX[i].keySymX == m_sym ) @@ -648,10 +648,10 @@ bool keyQtToMod( int keyQt, uint& mod ) { mod = 0; - if( keyQt & Qt::SHIFT ) mod |= KKey::SHIFT; - if( keyQt & Qt::CTRL ) mod |= KKey::CTRL; - if( keyQt & Qt::ALT ) mod |= KKey::ALT; - if( keyQt & Qt::META ) mod |= KKey::WIN; + if( keyQt & TQt::SHIFT ) mod |= KKey::SHIFT; + if( keyQt & TQt::CTRL ) mod |= KKey::CTRL; + if( keyQt & TQt::ALT ) mod |= KKey::ALT; + if( keyQt & TQt::META ) mod |= KKey::WIN; return true; } @@ -688,9 +688,9 @@ bool modXToModQt( uint modX, int& modQt ) TDECORE_EXPORT int qtButtonStateToMod( TQt::ButtonState s ) { int modQt = 0; - if (s & Qt::ShiftButton) modQt |= KKey::SHIFT; - if (s & Qt::ControlButton) modQt |= KKey::CTRL; - if (s & Qt::AltButton) modQt |= KKey::ALT; + if (s & TQt::ShiftButton) modQt |= KKey::SHIFT; + if (s & TQt::ControlButton) modQt |= KKey::CTRL; + if (s & TQt::AltButton) modQt |= KKey::ALT; return modQt; } @@ -841,7 +841,7 @@ uint stringUserToMod( const TQString& mod ) if( keySymQt < 0x1000 ) { // For reasons unbeknownst to me, Qt converts 'a-z' to 'A-Z'. // So convert it back to lowercase if SHIFT isn't held down. - if( keySymQt >= Qt::Key_A && keySymQt <= Qt::Key_Z && !(keyCombQt & Qt::SHIFT) ) + if( keySymQt >= TQt::Key_A && keySymQt <= TQt::Key_Z && !(keyCombQt & TQt::SHIFT) ) keySymQt = tolower( keySymQt ); keySymX = keySymQt; } |