KAccel: allow for 4-modifier setup defaults, check whether Qt supports the

Meta key.

KGlobalAccel: improve X key ungrabbing for key map changes.

KKeyDialog: Allow caller to specify whether normal keys (i.e., 'A', 'B') can
be used as shortcuts and whether the Meta key can be used in a shortcut.

KeyConfog: Add support for a second default configuration. Add support for a
user with a Meta key not to default to 4-modifier setup (not yet working
completely).

Workspace: Added 'Window iconify all'.  Still speed work -- best might be to
merge this with 'Show Desktop'

kcontrol/keys/main.cpp: a bit of capitalization

kcontrol/kwm/mouse, kwin/client, kwin/options: Let user use Meta key for
window resizing/moving/etc

*bindings.cpp: add 4-modifier setup defaults

svn path=/trunk/kdebase/kcontrol/; revision=100877
This commit is contained in:
Ellis Whitehead 2001-06-07 18:17:24 +00:00
parent d4dabdb756
commit a9c55776ae
6 changed files with 72 additions and 52 deletions

View file

@ -26,6 +26,7 @@ Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
#include "client.h"
#include "events.h"
#include "atoms.h"
#include <kaccel.h> // Needed in x11Event() below
#include <X11/X.h>
#include <X11/Xos.h>
#include <X11/Xlib.h>
@ -403,17 +404,19 @@ bool WindowWrapper::x11Event( XEvent * e)
switch ( e->type ) {
case ButtonPress:
{
bool mod1 = (e->xbutton.state & Mod1Mask) == Mod1Mask;
uint keyModX = (options->keyCmdAllModKey() == Qt::Key_Meta) ?
KAccel::keyModXMeta() : KAccel::keyModXAlt();
bool bModKeyHeld = e->xbutton.state & keyModX;
if ( ((Client*)parentWidget())->isActive()
&& ( options->focusPolicy != Options::ClickToFocus
&& options->clickRaise && !mod1 ) ) {
&& options->clickRaise && !bModKeyHeld ) ) {
((Client*)parentWidget())->autoRaise();
ungrabButton( winId(), None );
}
Options::MouseCommand com = Options::MouseNothing;
if ( mod1){
if ( bModKeyHeld ){
switch (e->xbutton.button) {
case Button1:
com = options->commandAll1();

View file

@ -1,47 +1,48 @@
keys->insertItem(i18n("Switch to desktop 1"), "Switch to desktop 1" ,"CTRL+F1");
keys->insertItem(i18n("Switch to desktop 2"), "Switch to desktop 2" ,"CTRL+F2");
keys->insertItem(i18n("Switch to desktop 3"), "Switch to desktop 3" ,"CTRL+F3");
keys->insertItem(i18n("Switch to desktop 4"), "Switch to desktop 4" ,"CTRL+F4");
keys->insertItem(i18n("Switch to desktop 5"), "Switch to desktop 5" ,"CTRL+F5");
keys->insertItem(i18n("Switch to desktop 6"), "Switch to desktop 6" ,"CTRL+F6");
keys->insertItem(i18n("Switch to desktop 7"), "Switch to desktop 7" ,"CTRL+F7");
keys->insertItem(i18n("Switch to desktop 8"), "Switch to desktop 8" ,"CTRL+F8");
keys->insertItem(i18n("Switch to desktop 9"), "Switch to desktop 9" ,"CTRL+F9");
keys->insertItem(i18n("Switch to desktop 10"), "Switch to desktop 10" ,"CTRL+F10");
keys->insertItem(i18n("Switch to desktop 11"), "Switch to desktop 11" ,"CTRL+F11");
keys->insertItem(i18n("Switch to desktop 12"), "Switch to desktop 12" ,"CTRL+F12");
keys->insertItem(i18n("Switch to desktop 13"), "Switch to desktop 13" ,"CTRL+SHIFT+F1");
keys->insertItem(i18n("Switch to desktop 14"), "Switch to desktop 14" ,"CTRL+SHIFT+F2");
keys->insertItem(i18n("Switch to desktop 15"), "Switch to desktop 15" ,"CTRL+SHIFT+F3");
keys->insertItem(i18n("Switch to desktop 16"), "Switch to desktop 16" ,"CTRL+SHIFT+F4");
keys->insertItem(i18n("Switch to next desktop"), "Switch desktop next" ,"");
keys->insertItem(i18n("Switch to previous desktop"), "Switch desktop previous" ,"");
keys->insertItem(i18n("Switch one desktop to the right"), "Switch desktop right" ,"");
keys->insertItem(i18n("Switch one desktop to the left"), "Switch desktop left" ,"");
keys->insertItem(i18n("Switch one desktop up"), "Switch desktop up" ,"");
keys->insertItem(i18n("Switch one desktop down"), "Switch desktop down" ,"");
keys->insertItem(i18n("Switch to desktop 1"), "Switch to desktop 1", KKey("CTRL+F1"), KKey("Meta+1"));
keys->insertItem(i18n("Switch to desktop 2"), "Switch to desktop 2", KKey("CTRL+F2"), KKey("Meta+2"));
keys->insertItem(i18n("Switch to desktop 3"), "Switch to desktop 3", KKey("CTRL+F3"), KKey("Meta+3"));
keys->insertItem(i18n("Switch to desktop 4"), "Switch to desktop 4", KKey("CTRL+F4"), KKey("Meta+4"));
keys->insertItem(i18n("Switch to desktop 5"), "Switch to desktop 5", KKey("CTRL+F5"), KKey("Meta+5"));
keys->insertItem(i18n("Switch to desktop 6"), "Switch to desktop 6", KKey("CTRL+F6"), KKey("Meta+6"));
keys->insertItem(i18n("Switch to desktop 7"), "Switch to desktop 7", KKey("CTRL+F7"), KKey("Meta+7"));
keys->insertItem(i18n("Switch to desktop 8"), "Switch to desktop 8", KKey("CTRL+F8"), KKey("Meta+8"));
keys->insertItem(i18n("Switch to desktop 9"), "Switch to desktop 9", KKey("CTRL+F9"), KKey("Meta+9"));
keys->insertItem(i18n("Switch to desktop 10"), "Switch to desktop 10", KKey("CTRL+F10"), KKey());
keys->insertItem(i18n("Switch to desktop 11"), "Switch to desktop 11", KKey("CTRL+F11"), KKey());
keys->insertItem(i18n("Switch to desktop 12"), "Switch to desktop 12", KKey("CTRL+F12"), KKey());
keys->insertItem(i18n("Switch to desktop 13"), "Switch to desktop 13", KKey("CTRL+SHIFT+F1"), KKey());
keys->insertItem(i18n("Switch to desktop 14"), "Switch to desktop 14", KKey("CTRL+SHIFT+F2"), KKey());
keys->insertItem(i18n("Switch to desktop 15"), "Switch to desktop 15", KKey("CTRL+SHIFT+F3"), KKey());
keys->insertItem(i18n("Switch to desktop 16"), "Switch to desktop 16", KKey("CTRL+SHIFT+F4"), KKey());
keys->insertItem(i18n("Switch to next desktop"), "Switch desktop next", KKey().key());
keys->insertItem(i18n("Switch to previous desktop"), "Switch desktop previous", KKey().key());
keys->insertItem(i18n("Switch one desktop to the right"), "Switch desktop right", KKey().key());
keys->insertItem(i18n("Switch one desktop to the left"), "Switch desktop left", KKey().key());
keys->insertItem(i18n("Switch one desktop up"), "Switch desktop up", KKey().key());
keys->insertItem(i18n("Switch one desktop down"), "Switch desktop down", KKey().key());
keys->insertItem(i18n("Window operations menu"), "Pop-up window operations menu" ,"ALT+F3");
keys->insertItem(i18n("Window close"),"Window close", "ALT+F4");
keys->insertItem(i18n("Window maximize"),"Window maximize", "Meta+Plus");
keys->insertItem(i18n("Window maximize vertical"),"Window maximize vertical", "Meta+Bar");
keys->insertItem(i18n("Window maximize horizontal"),"Window maximize horizontal", "Meta+Equal");
keys->insertItem(i18n("Window iconify"),"Window iconify", "Meta+Minus");
keys->insertItem(i18n("Window shade"),"Window shade", "Meta+Underscore");
keys->insertItem(i18n("Window move"),"Window move", "");
keys->insertItem(i18n("Window resize"),"Window resize", "");
keys->insertItem(i18n("Window raise"),"Window raise", "");
keys->insertItem(i18n("Window lower"),"Window lower", "");
keys->insertItem(i18n("Window raise or lower"), "Toggle raise and lower", "");
keys->insertItem(i18n("Window to next desktop"),"Window to next desktop", "");
keys->insertItem(i18n("Window to previous desktop"),"Window to previous desktop", "");
keys->insertItem(i18n("Window operations menu"), "Pop-up window operations menu", KKey("ALT+F3"), KKey("Alt+Space"));
keys->insertItem(i18n("Window close"), "Window close", KKey("ALT+F4"), KKey("Alt+Escape"));
keys->insertItem(i18n("Window maximize"), "Window maximize", KKey(), KKey("Meta+Plus"));
keys->insertItem(i18n("Window maximize vertical"), "Window maximize vertical", KKey(), KKey("Meta+Bar"));
keys->insertItem(i18n("Window maximize horizontal"), "Window maximize horizontal", KKey(), KKey("Meta+Equal"));
keys->insertItem(i18n("Window iconify"), "Window iconify", KKey(), KKey("Meta+Minus"));
keys->insertItem(i18n("Window iconify (all)"), "Window iconify all", KKey(), KKey("Meta+Ctrl+Minus"));
keys->insertItem(i18n("Window shade"), "Window shade", KKey(), KKey("Meta+Underscore"));
keys->insertItem(i18n("Window move"), "Window move", 0);
keys->insertItem(i18n("Window resize"), "Window resize", 0);
keys->insertItem(i18n("Window raise"), "Window raise", 0);
keys->insertItem(i18n("Window lower"), "Window lower", 0);
keys->insertItem(i18n("Window raise or lower"), "Toggle raise and lower", 0);
keys->insertItem(i18n("Window to next desktop"), "Window to next desktop", 0);
keys->insertItem(i18n("Window to previous desktop"), "Window to previous desktop", 0);
keys->insertItem(i18n("Walk through desktops"),"Walk through desktops", "CTRL+Tab");
keys->insertItem(i18n("Walk back through desktops"),"Walk back through desktops", "SHIFT+CTRL+Tab");
keys->insertItem(i18n("Walk through windows"),"Walk through windows", "ALT+Tab");
keys->insertItem(i18n("Walk back through windows"),"Walk back through windows", "SHIFT+ALT+Tab");
keys->insertItem(i18n("Walk through desktops"), "Walk through desktops", KKey("CTRL+Tab"), KKey("Meta+Tab"));
keys->insertItem(i18n("Walk back through desktops"), "Walk back through desktops", KKey("SHIFT+CTRL+Tab"), KKey("Meta+Shift+Tab"));
keys->insertItem(i18n("Walk through windows"), "Walk through windows", KKey("ALT+Tab"), KKey("Alt+Tab"));
keys->insertItem(i18n("Walk back through windows"), "Walk back through windows", KKey("SHIFT+ALT+Tab"), KKey("Alt+Shift+Tab"));
keys->insertItem(i18n("Mouse emulation"),"Mouse emulation", "ALT+F12");
keys->insertItem(i18n("Mouse emulation"), "Mouse emulation", KKey("ALT+F12"), KKey("Meta+F12"));
keys->insertItem(i18n("Kill Window"), "Kill Window", KKey("CTRL+ALT+Escape"), KKey("Meta+Ctrl+Delete"));
keys->insertItem(i18n("Kill Window"),"Kill Window", "CTRL+ALT+Escape");

View file

@ -10,6 +10,7 @@ Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
#include <kconfig.h>
#include <kglobal.h>
#include <kglobalsettings.h>
#include <kaccel.h> // for KAccel::keyboardHasMetaKey()
using namespace KWinInternal;
@ -239,6 +240,7 @@ void Options::reload()
CmdWindow1 = mouseCommand(config->readEntry("CommandWindow1","Activate, raise and pass click"));
CmdWindow2 = mouseCommand(config->readEntry("CommandWindow2","Activate and pass click"));
CmdWindow3 = mouseCommand(config->readEntry("CommandWindow3","Activate and pass click"));
CmdAllModKey = (config->readEntry("CommandAllKey", KAccel::keyboardHasMetaKey() ? "Meta" : "Alt") == "Meta") ? Qt::Key_Meta : Qt::Key_Alt;
CmdAll1 = mouseCommand(config->readEntry("CommandAll1","Move"));
CmdAll2 = mouseCommand(config->readEntry("CommandAll2","Toggle raise and lower"));
CmdAll3 = mouseCommand(config->readEntry("CommandAll3","Resize"));
@ -254,7 +256,7 @@ void Options::reload()
d->title_buttons_left = "MS";
d->title_buttons_right = "HIAX";
}
emit resetPlugin();
emit resetClients();
}
@ -308,16 +310,16 @@ QString Options::titleButtonsLeft()
{
return d->title_buttons_left;
}
QString Options::titleButtonsRight()
{
return d->title_buttons_right;
}
bool Options::customButtonPositions()
{
return d->custom_button_positions;
}
#include "options.moc"

View file

@ -231,7 +231,7 @@ public:
MouseRaise, MouseLower, MouseOperationsMenu, MouseToggleRaiseAndLower,
MouseActivateAndRaise, MouseActivateAndLower, MouseActivate,
MouseActivateRaiseAndPassClick, MouseActivateAndPassClick,
MouseMove, MouseResize,
MouseMove, MouseResize,
MouseShade,
MouseNothing
};
@ -248,6 +248,7 @@ public:
MouseCommand commandAll1() { return CmdAll1; }
MouseCommand commandAll2() { return CmdAll2; }
MouseCommand commandAll3() { return CmdAll3; }
uint keyCmdAllModKey() { return CmdAllModKey; }
static WindowOperation windowOperation(const QString &name );
@ -316,7 +317,8 @@ private:
MouseCommand CmdAll1;
MouseCommand CmdAll2;
MouseCommand CmdAll3;
uint CmdAllModKey;
OptionsPrivate* d;
};

View file

@ -2413,6 +2413,7 @@ void Workspace::createKeybindings(){
keys->connectItem( "Window maximize horizontal", this, SLOT( slotWindowMaximizeHorizontal() ) );
keys->connectItem( "Window maximize vertical", this, SLOT( slotWindowMaximizeVertical() ) );
keys->connectItem( "Window iconify", this, SLOT( slotWindowIconify() ) );
keys->connectItem( "Window iconify all", this, SLOT( slotWindowIconifyAll() ) );
keys->connectItem( "Window shade", this, SLOT( slotWindowShade() ) );
keys->connectItem( "Window move", this, SLOT( slotWindowMove() ) );
keys->connectItem( "Window resize", this, SLOT( slotWindowResize() ) );
@ -2564,6 +2565,16 @@ void Workspace::slotWindowIconify()
performWindowOperation( popup_client, Options::IconifyOp );
}
void Workspace::slotWindowIconifyAll()
{
int iDesktop = currentDesktop();
for ( ClientList::ConstIterator it = clients.begin(); it != clients.end(); ++it) {
if( (*it)->isOnDesktop( iDesktop ) && !(*it)->isIconified() )
performWindowOperation( *it, Options::IconifyOp );
}
}
/*!
Shades/unshades the popup client respectively
*/

View file

@ -246,6 +246,7 @@ public slots:
void slotWindowMaximizeVertical();
void slotWindowMaximizeHorizontal();
void slotWindowIconify();
void slotWindowIconifyAll();
void slotWindowShade();
void slotWindowRaise();
void slotWindowLower();