kwinbindings.cpp

00001 #ifndef NOSLOTS
00002 # define DEF2( name, descr, key3, key4, fnSlot ) \
00003    keys->insert( name, i18n(descr), QString::null, key3, key4, this, SLOT(fnSlot) )
00004 # define DEF( name, key3, key4, fnSlot ) \
00005    keys->insert( name, i18n(name), QString::null, key3, key4, this, SLOT(fnSlot) )
00006 #else
00007 # define DEF2( name, descr, key3, key4, fnSlot ) \
00008    keys->insert( name, i18n(descr), QString::null, key3, key4 )
00009 # define DEF( name, key3, key4, fnSlot ) \
00010    keys->insert( name, i18n(name), QString::null, key3, key4 )
00011 #endif
00012 
00013 #define WIN KKey::QtWIN
00014 
00015 // some shortcuts have Tarzan-speech like names, they need extra normal human descriptions with DEF2()
00016 // the others can use DEF()
00017 
00018     keys->insert( "Program:kwin", i18n("System") );
00019 
00020     keys->insert( "Group:Navigation", i18n("Navigation") );
00021     DEF( I18N_NOOP("Walk Through Windows"),                ALT+Qt::Key_Tab, ALT+Qt::Key_Tab, slotWalkThroughWindows() );
00022     DEF( I18N_NOOP("Walk Through Windows (Reverse)"),      ALT+SHIFT+Qt::Key_Tab, ALT+SHIFT+Qt::Key_Tab, slotWalkBackThroughWindows() );
00023     DEF( I18N_NOOP("Walk Through Desktops"),               0, WIN+Qt::Key_Tab, slotWalkThroughDesktops() );
00024     DEF( I18N_NOOP("Walk Through Desktops (Reverse)"),     0, WIN+SHIFT+Qt::Key_Tab, slotWalkBackThroughDesktops() );
00025     DEF( I18N_NOOP("Walk Through Desktop List"),           0, 0, slotWalkThroughDesktopList() );
00026     DEF( I18N_NOOP("Walk Through Desktop List (Reverse)"), 0, 0, slotWalkBackThroughDesktopList() );
00027 
00028     keys->insert( "Group:Windows", i18n("Windows") );
00029     DEF( I18N_NOOP("Window Operations Menu"),              ALT+Qt::Key_F3, ALT+Qt::Key_Menu, slotWindowOperations() );
00030     DEF2( "Window Close", I18N_NOOP("Close Window"),
00031             ALT+Qt::Key_F4, "Alt+Escape;Alt+F4", slotWindowClose() );
00032     DEF2( "Window Maximize", I18N_NOOP("Maximize Window"),
00033             0, WIN+Qt::Key_Plus, slotWindowMaximize() );
00034     DEF2( "Window Maximize Vertical", I18N_NOOP("Maximize Window Vertically"),
00035             0, WIN+Qt::Key_Bar, slotWindowMaximizeVertical() );
00036     DEF2( "Window Maximize Horizontal", I18N_NOOP("Maximize Window Horizontally"),
00037             0, WIN+Qt::Key_Equal, slotWindowMaximizeHorizontal() );
00038     DEF2( "Window Minimize", I18N_NOOP("Minimize Window"),
00039             0, WIN+Qt::Key_Minus, slotWindowMinimize() );
00040     DEF2( "Window Shade", I18N_NOOP("Shade Window"),
00041             0, WIN+Qt::Key_Underscore, slotWindowShade() );
00042     DEF2( "Window Move", I18N_NOOP("Move Window"),
00043             0, 0, slotWindowMove() );
00044     DEF2( "Window Resize", I18N_NOOP("Resize Window"),
00045             0, 0, slotWindowResize() );
00046     DEF2( "Window Raise", I18N_NOOP("Raise Window"),
00047             0, 0, slotWindowRaise() );
00048     DEF2( "Window Lower", I18N_NOOP("Lower Window"),
00049             0, 0, slotWindowLower() );
00050     DEF( I18N_NOOP("Toggle Window Raise/Lower"),           0, 0, slotWindowRaiseOrLower() );
00051         DEF2( "Window Fullscreen", I18N_NOOP("Make Window Fullscreen"),
00052             0, 0, slotWindowFullScreen() );
00053         DEF2( "Window No Border", I18N_NOOP("Hide Window Border"),
00054             0, 0, slotWindowNoBorder() );
00055         DEF2( "Window Above Other Windows", I18N_NOOP("Keep Window Above Others"),
00056             0, 0, slotWindowAbove() );
00057         DEF2( "Window Below Other Windows", I18N_NOOP("Keep Window Below Others"),
00058             0, 0, slotWindowBelow() );
00059         DEF( I18N_NOOP("Activate Window Demanding Attention"), CTRL+ALT+Qt::Key_A, 0, slotActivateAttentionWindow());
00060         DEF( I18N_NOOP("Setup Window Shortcut"), 0, 0, slotSetupWindowShortcut());
00061         DEF2( "Window Pack Right", I18N_NOOP("Pack Window to the Right"),
00062             0, 0, slotWindowPackRight() );
00063         DEF2( "Window Pack Left", I18N_NOOP("Pack Window to the Left"),
00064             0, 0, slotWindowPackLeft() );
00065         DEF2( "Window Pack Up", I18N_NOOP("Pack Window Up"),
00066             0, 0, slotWindowPackUp() );
00067         DEF2( "Window Pack Down", I18N_NOOP("Pack Window Down"),
00068             0, 0, slotWindowPackDown() );
00069         DEF2( "Window Grow Horizontal", I18N_NOOP("Pack Grow Window Horizontally"),
00070             0, 0, slotWindowGrowHorizontal() );
00071         DEF2( "Window Grow Vertical", I18N_NOOP("Pack Grow Window Vertically"),
00072             0, 0, slotWindowGrowVertical() );
00073         DEF2( "Window Shrink Horizontal", I18N_NOOP("Pack Shrink Window Horizontally"),
00074             0, 0, slotWindowShrinkHorizontal() );
00075         DEF2( "Window Shrink Vertical", I18N_NOOP("Pack Shrink Window Vertically"),
00076             0, 0, slotWindowShrinkVertical() );
00077 
00078     keys->insert( "Group:Window Desktop", i18n("Window & Desktop") );
00079         DEF2( "Window On All Desktops", I18N_NOOP("Keep Window on All Desktops"),
00080             0, 0, slotWindowOnAllDesktops() );
00081     DEF( I18N_NOOP("Window to Desktop 1"),                 0, WIN+ALT+Qt::Key_F1, slotWindowToDesktop(int) );
00082     DEF( I18N_NOOP("Window to Desktop 2"),                 0, WIN+ALT+Qt::Key_F2, slotWindowToDesktop(int) );
00083     DEF( I18N_NOOP("Window to Desktop 3"),                 0, WIN+ALT+Qt::Key_F3, slotWindowToDesktop(int) );
00084     DEF( I18N_NOOP("Window to Desktop 4"),                 0, WIN+ALT+Qt::Key_F4, slotWindowToDesktop(int) );
00085     DEF( I18N_NOOP("Window to Desktop 5"),                 0, WIN+ALT+Qt::Key_F5, slotWindowToDesktop(int) );
00086     DEF( I18N_NOOP("Window to Desktop 6"),                 0, WIN+ALT+Qt::Key_F6, slotWindowToDesktop(int) );
00087     DEF( I18N_NOOP("Window to Desktop 7"),                 0, WIN+ALT+Qt::Key_F7, slotWindowToDesktop(int) );
00088     DEF( I18N_NOOP("Window to Desktop 8"),                 0, WIN+ALT+Qt::Key_F8, slotWindowToDesktop(int) );
00089     DEF( I18N_NOOP("Window to Desktop 9"),                 0, WIN+ALT+Qt::Key_F9, slotWindowToDesktop(int) );
00090     DEF( I18N_NOOP("Window to Desktop 10"),                0, WIN+ALT+Qt::Key_F10, slotWindowToDesktop(int) );
00091     DEF( I18N_NOOP("Window to Desktop 11"),                0, 0, slotWindowToDesktop(int) );
00092     DEF( I18N_NOOP("Window to Desktop 12"),                0, 0, slotWindowToDesktop(int) );
00093     DEF( I18N_NOOP("Window to Desktop 13"),                0, 0, slotWindowToDesktop(int) );
00094     DEF( I18N_NOOP("Window to Desktop 14"),                0, 0, slotWindowToDesktop(int) );
00095     DEF( I18N_NOOP("Window to Desktop 15"),                0, 0, slotWindowToDesktop(int) );
00096     DEF( I18N_NOOP("Window to Desktop 16"),                0, 0, slotWindowToDesktop(int) );
00097     DEF( I18N_NOOP("Window to Desktop 17"),                0, 0, slotWindowToDesktop(int) );
00098     DEF( I18N_NOOP("Window to Desktop 18"),                0, 0, slotWindowToDesktop(int) );
00099     DEF( I18N_NOOP("Window to Desktop 19"),                0, 0, slotWindowToDesktop(int) );
00100     DEF( I18N_NOOP("Window to Desktop 20"),                0, 0, slotWindowToDesktop(int) );
00101     DEF( I18N_NOOP("Window to Next Desktop"),              0, 0, slotWindowToNextDesktop() );
00102     DEF( I18N_NOOP("Window to Previous Desktop"),          0, 0, slotWindowToPreviousDesktop() );
00103     DEF( I18N_NOOP("Window One Desktop to the Right"),     0, 0, slotWindowToDesktopRight() );
00104     DEF( I18N_NOOP("Window One Desktop to the Left"),      0, 0, slotWindowToDesktopLeft() );
00105     DEF( I18N_NOOP("Window One Desktop Up"),               0, 0, slotWindowToDesktopUp() );
00106     DEF( I18N_NOOP("Window One Desktop Down"),             0, 0, slotWindowToDesktopDown() );
00107 
00108     keys->insert( "Group:Desktop Switching", i18n("Desktop Switching") );
00109     DEF( I18N_NOOP("Switch to Desktop 1"),  CTRL+Qt::Key_F1, WIN+Qt::Key_F1, slotSwitchToDesktop(int) );
00110     DEF( I18N_NOOP("Switch to Desktop 2"),  CTRL+Qt::Key_F2, WIN+Qt::Key_F2, slotSwitchToDesktop(int) );
00111     DEF( I18N_NOOP("Switch to Desktop 3"),  CTRL+Qt::Key_F3, WIN+Qt::Key_F3, slotSwitchToDesktop(int) );
00112     DEF( I18N_NOOP("Switch to Desktop 4"),  CTRL+Qt::Key_F4, WIN+Qt::Key_F4, slotSwitchToDesktop(int) );
00113     DEF( I18N_NOOP("Switch to Desktop 5"),  CTRL+Qt::Key_F5, WIN+Qt::Key_F5, slotSwitchToDesktop(int) );
00114     DEF( I18N_NOOP("Switch to Desktop 6"),  CTRL+Qt::Key_F6, WIN+Qt::Key_F6, slotSwitchToDesktop(int) );
00115     DEF( I18N_NOOP("Switch to Desktop 7"),  CTRL+Qt::Key_F7, WIN+Qt::Key_F7, slotSwitchToDesktop(int) );
00116     DEF( I18N_NOOP("Switch to Desktop 8"),  CTRL+Qt::Key_F8, WIN+Qt::Key_F8, slotSwitchToDesktop(int) );
00117     DEF( I18N_NOOP("Switch to Desktop 9"),  CTRL+Qt::Key_F9, WIN+Qt::Key_F9, slotSwitchToDesktop(int) );
00118     DEF( I18N_NOOP("Switch to Desktop 10"),  CTRL+Qt::Key_F10, WIN+Qt::Key_F10, slotSwitchToDesktop(int) );
00119     DEF( I18N_NOOP("Switch to Desktop 11"),  CTRL+Qt::Key_F11, 0, slotSwitchToDesktop(int) );
00120     DEF( I18N_NOOP("Switch to Desktop 12"),  CTRL+Qt::Key_F12, 0, slotSwitchToDesktop(int) );
00121     DEF( I18N_NOOP("Switch to Desktop 13"),  CTRL+SHIFT+Qt::Key_F1, 0, slotSwitchToDesktop(int) );
00122     DEF( I18N_NOOP("Switch to Desktop 14"),  CTRL+SHIFT+Qt::Key_F2, 0, slotSwitchToDesktop(int) );
00123     DEF( I18N_NOOP("Switch to Desktop 15"),  CTRL+SHIFT+Qt::Key_F3, 0, slotSwitchToDesktop(int) );
00124     DEF( I18N_NOOP("Switch to Desktop 16"),  CTRL+SHIFT+Qt::Key_F4, 0, slotSwitchToDesktop(int) );
00125     DEF( I18N_NOOP("Switch to Desktop 17"),  CTRL+SHIFT+Qt::Key_F5, 0, slotSwitchToDesktop(int) );
00126     DEF( I18N_NOOP("Switch to Desktop 18"),  CTRL+SHIFT+Qt::Key_F6, 0, slotSwitchToDesktop(int) );
00127     DEF( I18N_NOOP("Switch to Desktop 19"),  CTRL+SHIFT+Qt::Key_F7, 0, slotSwitchToDesktop(int) );
00128     DEF( I18N_NOOP("Switch to Desktop 20"),  CTRL+SHIFT+Qt::Key_F8, 0, slotSwitchToDesktop(int) );
00129     DEF( I18N_NOOP("Switch to Next Desktop"),              0, 0, slotSwitchDesktopNext() );
00130     DEF( I18N_NOOP("Switch to Previous Desktop"),          0, 0, slotSwitchDesktopPrevious() );
00131     DEF( I18N_NOOP("Switch One Desktop to the Right"),     0, 0, slotSwitchDesktopRight() );
00132     DEF( I18N_NOOP("Switch One Desktop to the Left"),      0, 0, slotSwitchDesktopLeft() );
00133     DEF( I18N_NOOP("Switch One Desktop Up"),               0, 0, slotSwitchDesktopUp() );
00134     DEF( I18N_NOOP("Switch One Desktop Down"),             0, 0, slotSwitchDesktopDown() );
00135 
00136     keys->insert( "Group:Miscellaneous", i18n("Miscellaneous") );
00137     DEF( I18N_NOOP("Mouse Emulation"),                     ALT+Qt::Key_F12, 0, slotMouseEmulation() );
00138     DEF( I18N_NOOP("Kill Window"),                         ALT+CTRL+Qt::Key_Escape, WIN+CTRL+Qt::Key_Delete, slotKillWindow() );
00139     DEF( I18N_NOOP("Window Screenshot"),                   ALT+Qt::Key_Print, ALT+Qt::Key_Print, slotGrabWindow() );
00140     DEF( I18N_NOOP("Desktop Screenshot"),                  CTRL+Qt::Key_Print, WIN+Qt::Key_Print, slotGrabDesktop() );
00141 #ifdef IN_KWIN
00142         {
00143         KGlobalAccel* keys = disable_shortcuts_keys;
00144 #endif
00145         DEF( I18N_NOOP("Block Global Shortcuts"),            0, 0, slotDisableGlobalShortcuts());
00146 #ifdef IN_KWIN
00147         }
00148 #endif
00149 
00150 /*This belongs in taskbar rather than here, so it'll have to wait until after 2.2 is done.
00151   -- ellis
00152 DEF( I18N_NOOP("Switch to Window 1", WIN+Qt::Key_1"));
00153 DEF( I18N_NOOP("Switch to Window 2", WIN+Qt::Key_2"));
00154 DEF( I18N_NOOP("Switch to Window 3", WIN+Qt::Key_3"));
00155 DEF( I18N_NOOP("Switch to Window 4", WIN+Qt::Key_4"));
00156 DEF( I18N_NOOP("Switch to Window 5", WIN+Qt::Key_5"));
00157 DEF( I18N_NOOP("Switch to Window 6", WIN+Qt::Key_6"));
00158 DEF( I18N_NOOP("Switch to Window 7", WIN+Qt::Key_7"));
00159 DEF( I18N_NOOP("Switch to Window 8", WIN+Qt::Key_8"));
00160 DEF( I18N_NOOP("Switch to Window 9", WIN+Qt::Key_9"));
00161 
00162 #ifdef WITH_LABELS
00163 DEF( I18N_NOOP("Window & Taskbar"Group:Window Desktop", 0);
00164 #endif
00165 DEF( I18N_NOOP("Window to Taskbar Position 1", WIN+Qt::Key_Alt+1"));
00166 DEF( I18N_NOOP("Window to Taskbar Position 2", WIN+Qt::Key_Alt+2"));
00167 DEF( I18N_NOOP("Window to Taskbar Position 3", WIN+Qt::Key_Alt+3"));
00168 DEF( I18N_NOOP("Window to Taskbar Position 4", WIN+Qt::Key_Alt+4"));
00169 DEF( I18N_NOOP("Window to Taskbar Position 5", WIN+Qt::Key_Alt+5"));
00170 DEF( I18N_NOOP("Window to Taskbar Position 6", WIN+Qt::Key_Alt+6"));
00171 DEF( I18N_NOOP("Window to Taskbar Position 7", WIN+Qt::Key_Alt+7"));
00172 DEF( I18N_NOOP("Window to Taskbar Position 8", WIN+Qt::Key_Alt+8"));
00173 DEF( I18N_NOOP("Window to Taskbar Position 9", WIN+Qt::Key_Alt+9"));
00174 */
00175 
00176 #undef DEF
00177 #undef DEF2
00178 #undef WIN
KDE Home | KDE Accessibility Home | Description of Access Keys