Call string <=> key conversion functions in KKey & KKeyX11 instead of KAccel

svn path=/trunk/kdebase/kcontrol/; revision=115761
icc-effect-5.14.5
Ellis Whitehead 2001-09-28 12:31:48 +00:00
parent df1676cdfe
commit 0223deb116
3 changed files with 8 additions and 7 deletions

View File

@ -25,7 +25,7 @@ Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
#include "client.h" #include "client.h"
#include "events.h" #include "events.h"
#include "atoms.h" #include "atoms.h"
#include <kaccel.h> // Needed in x11Event() below #include <kkey_x11.h> // Needed in x11Event() below
#include <netwm.h> #include <netwm.h>
#include <X11/X.h> #include <X11/X.h>
#include <X11/Xos.h> #include <X11/Xos.h>
@ -405,7 +405,7 @@ bool WindowWrapper::x11Event( XEvent * e)
case ButtonPress: case ButtonPress:
{ {
uint keyModX = (options->keyCmdAllModKey() == Qt::Key_Meta) ? uint keyModX = (options->keyCmdAllModKey() == Qt::Key_Meta) ?
KAccel::keyModXMeta() : KAccel::keyModXAlt(); KKeyX11::keyModXMeta() : KKeyX11::keyModXAlt();
bool bModKeyHeld = e->xbutton.state & keyModX; bool bModKeyHeld = e->xbutton.state & keyModX;
if ( ((Client*)parentWidget())->isActive() if ( ((Client*)parentWidget())->isActive()

View File

@ -10,7 +10,7 @@ Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
#include <kconfig.h> #include <kconfig.h>
#include <kglobal.h> #include <kglobal.h>
#include <kglobalsettings.h> #include <kglobalsettings.h>
#include <kaccel.h> // for KAccel::keyboardHasMetaKey() #include <kkey.h> // for KKeyX11::keyboardHasMetaKey()
using namespace KWinInternal; using namespace KWinInternal;
@ -247,7 +247,7 @@ void Options::reload()
CmdWindow1 = mouseCommand(config->readEntry("CommandWindow1","Activate, raise and pass click")); CmdWindow1 = mouseCommand(config->readEntry("CommandWindow1","Activate, raise and pass click"));
CmdWindow2 = mouseCommand(config->readEntry("CommandWindow2","Activate and pass click")); CmdWindow2 = mouseCommand(config->readEntry("CommandWindow2","Activate and pass click"));
CmdWindow3 = mouseCommand(config->readEntry("CommandWindow3","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; CmdAllModKey = (config->readEntry("CommandAllKey", KKey::keyboardHasMetaKey() ? "Meta" : "Alt") == "Meta") ? Qt::Key_Meta : Qt::Key_Alt;
CmdAll1 = mouseCommand(config->readEntry("CommandAll1","Move")); CmdAll1 = mouseCommand(config->readEntry("CommandAll1","Move"));
CmdAll2 = mouseCommand(config->readEntry("CommandAll2","Toggle raise and lower")); CmdAll2 = mouseCommand(config->readEntry("CommandAll2","Toggle raise and lower"));
CmdAll3 = mouseCommand(config->readEntry("CommandAll3","Resize")); CmdAll3 = mouseCommand(config->readEntry("CommandAll3","Resize"));

View File

@ -28,6 +28,7 @@ Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
#else #else
#include <qdesktopwidget.h> #include <qdesktopwidget.h>
#endif #endif
#include <kkey_x11.h>
#include "workspace.h" #include "workspace.h"
#include "client.h" #include "client.h"
#include "tabbox.h" #include "tabbox.h"
@ -1057,7 +1058,7 @@ bool Workspace::keyPress(XKeyEvent key)
if ( root != qt_xrootwin() ) if ( root != qt_xrootwin() )
return FALSE; return FALSE;
uint keyCombQt = KAccel::keyEventXToKeyQt( (XEvent*)&key ); uint keyCombQt = KKeyX11::keyEventXToKeyQt( (XEvent*)&key );
if (d->movingClient) if (d->movingClient)
{ {
d->movingClient->keyPressEvent(keyCombQt); d->movingClient->keyPressEvent(keyCombQt);
@ -1113,7 +1114,7 @@ bool Workspace::keyRelease(XKeyEvent key)
return FALSE; return FALSE;
if( !tab_grab && !control_grab ) if( !tab_grab && !control_grab )
return FALSE; return FALSE;
unsigned int mk = key.state & KAccel::accelModMaskX(); unsigned int mk = key.state & KKeyX11::accelModMaskX();
// key.state is state before the key release, so just checking mk being 0 isn't enough // key.state is state before the key release, so just checking mk being 0 isn't enough
// using XQueryPointer() also doesn't seem to work well, so the check that all // using XQueryPointer() also doesn't seem to work well, so the check that all
// modifiers are released is : only one modifier is active and the currently released // modifiers are released is : only one modifier is active and the currently released
@ -1547,7 +1548,7 @@ QPopupMenu* Workspace::clientPopup( Client* c )
popup->insertSeparator(); popup->insertSeparator();
QString k = KAccel::keyToString( keys->currentKey( "Window close" ), true ); QString k = KKey::keyToString( keys->currentKey( "Window close" ), true );
popup->insertItem( SmallIconSet( "remove" ), i18n("&Close")+'\t'+k, Options::CloseOp ); popup->insertItem( SmallIconSet( "remove" ), i18n("&Close")+'\t'+k, Options::CloseOp );
} }
return popup; return popup;