diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | 4aed2c8219774f5d797760606b8489a92ddc5163 (patch) | |
tree | 3f8c130f7d269626bf6a9447407ef6c35954426a /kcontrol/keys | |
download | tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.tar.gz tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kcontrol/keys')
28 files changed, 4579 insertions, 0 deletions
diff --git a/kcontrol/keys/ChangeLog b/kcontrol/keys/ChangeLog new file mode 100644 index 000000000..b8ef570df --- /dev/null +++ b/kcontrol/keys/ChangeLog @@ -0,0 +1,26 @@ +1999-08-19 Duncan Haldane <duncan@kde.org> + * removed left-over commented out code from change + decribed below, and adjusted help doc names to + index-1.html + +1999-02-28 Duncan Haldane <duncan@kde.org> + * commented out those unnecessary debug calls. + in keyconfig.cpp + +1998-12-19 Duncan Haldane <f.d.m.haldane@cwix.com> + * Converted global.cpp, global.h to keyconfig.cpp, + keyconfig.h, that can now be used to configure both + the standard keys and the global keys + in the same sophisticated manner as + global.cpp did for just the global keys. + * converted main.cpp to use keyconfig.cpp rather than + global.cpp and standard.cpp for standard and globall + key configuration. KGlobalConfig and KStdConfig disappear. + (KGlobalConfig is renamed to KKeyConfig) + * appropriate changes to Makefile.am. + * standard key binding are now #include'd from + stdbindings.cpp + * standard.cpp, standard.h are left here for now. + The entries that used to use them in main.cpp and + Makefile.am are just commented out for now. +
\ No newline at end of file diff --git a/kcontrol/keys/Makefile.am b/kcontrol/keys/Makefile.am new file mode 100644 index 000000000..ec706a7b1 --- /dev/null +++ b/kcontrol/keys/Makefile.am @@ -0,0 +1,22 @@ +kde_module_LTLIBRARIES = kcm_keys.la + +kcm_keys_la_SOURCES = shortcuts.cpp modifiers.cpp main.cpp khotkeys.cpp treeview.cpp commandShortcuts.cpp +kcm_keys_la_LIBADD = -lkdeui -lkio +kcm_keys_la_LDFLAGS = $(all_libraries) -module -avoid-version -no-undefined + +AM_CPPFLAGS= $(all_includes) + +METASOURCES = AUTO + +messages: + customkeys=`grep "^.include .\.\." keyconfig.cpp | sed -e "s#.*\"\(.*\)\"#\1#"` ;\ + $(XGETTEXT) $(kcm_keys_la_SOURCES) $$customkeys -o $(podir)/kcmkeys.pot + +update_DATA = kaccel.upd +update_SCRIPTS = convertShortcuts.pl +updatedir = $(kde_datadir)/kconf_update + +xdg_apps_DATA = keys.desktop + +scheme_DATA = wm3.kksrc kde3.kksrc kde4.kksrc win3.kksrc win4.kksrc mac4.kksrc unix3.kksrc +schemedir = $(kde_datadir)/kcmkeys diff --git a/kcontrol/keys/README b/kcontrol/keys/README new file mode 100644 index 000000000..14e09f73e --- /dev/null +++ b/kcontrol/keys/README @@ -0,0 +1,7 @@ +CHANGES V0.2 +- Global keys stored by default in ~/.kde/share/config/kdeglobals + [Global Keys] group +- KKeyDialog checks new key choices against exising bindings for the widget +and against entries in .kderc [Global Keys] +- kcmkeys now has two standard kcontrol pages - one for standard desktop +accelerators and one for global keybindings. diff --git a/kcontrol/keys/commandShortcuts.cpp b/kcontrol/keys/commandShortcuts.cpp new file mode 100644 index 000000000..446cd24ac --- /dev/null +++ b/kcontrol/keys/commandShortcuts.cpp @@ -0,0 +1,243 @@ +/* + * commandShortcuts.h + * + * Copyright (c) 2003 Aaron J. Seigo + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "commandShortcuts.h" +#include "treeview.h" + +#include <qbuttongroup.h> +#include <qlabel.h> +#include <qlayout.h> +#include <qradiobutton.h> +#include <qwhatsthis.h> + +#include <kactivelabel.h> +#include <kapplication.h> +#include <kmessagebox.h> +#include <kdialog.h> +#include <khotkeys.h> +#include <kkeybutton.h> +#include <klocale.h> + +static bool treeFilled = false; +CommandShortcutsModule::CommandShortcutsModule( QWidget *parent, const char *name ) +: QWidget( parent, name ) +{ + treeFilled = false; + initGUI(); +} + +CommandShortcutsModule::~CommandShortcutsModule() +{ +} + +// Called when [Reset] is pressed +void CommandShortcutsModule::load() +{ + defaults(); +} + +void CommandShortcutsModule::save() +{ + for (treeItemListIterator it(m_changedItems); it.current(); ++it) + { + KHotKeys::changeMenuEntryShortcut(it.current()->storageId(), it.current()->accel()); + } + m_changedItems.clear(); +} + +void CommandShortcutsModule::defaults() +{ + m_tree->clear(); + m_tree->fill(); +} + +QString CommandShortcutsModule::quickHelp() const +{ + return i18n("<h1>Command Shortcuts</h1> Using key bindings you can configure applications " + "and commands to be triggered when you press a key or a combination of keys."); +} + +void CommandShortcutsModule::initGUI() +{ + QVBoxLayout* mainLayout = new QVBoxLayout(this, KDialog::marginHint()); + mainLayout->addSpacing( KDialog::marginHint() ); + + KActiveLabel* label = new KActiveLabel(this); + label->setText(i18n("<qt>Below is a list of known commands which you may assign keyboard shortcuts to. " + "To edit, add or remove entries from this list use the " + "<a href=\"launchMenuEditor\">KDE menu editor</a>.</qt>")); + label->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum); + disconnect(label, SIGNAL(linkClicked(const QString &)), label, SLOT(openLink(const QString &))); + connect(label, SIGNAL(linkClicked(const QString &)), this, SLOT(launchMenuEditor())); + mainLayout->addWidget(label); + + m_tree = new AppTreeView(this, "appTreeView"); + m_tree->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding); + mainLayout->setStretchFactor(m_tree, 10); + mainLayout->addWidget(m_tree); + QWhatsThis::add(m_tree, + i18n("This is a list of all the desktop applications and commands " + "currently defined on this system. Click to select a command to " + "assign a keyboard shortcut to. Complete management of these " + "entries can be done via the menu editor program.")); + connect(m_tree, SIGNAL(entrySelected(const QString&, const QString &, bool)), + this, SLOT(commandSelected(const QString&, const QString &, bool))); + connect(m_tree, SIGNAL(doubleClicked(QListViewItem *, const QPoint &, int)), + this, SLOT(commandDoubleClicked(QListViewItem *, const QPoint &, int))); + m_shortcutBox = new QButtonGroup(i18n("Shortcut for Selected Command"), this); + mainLayout->addWidget(m_shortcutBox); + QHBoxLayout* buttonLayout = new QHBoxLayout(m_shortcutBox, KDialog::marginHint() * 2); + buttonLayout->addSpacing( KDialog::marginHint() ); + + m_noneRadio = new QRadioButton(i18n("no key", "&None"), m_shortcutBox); + QWhatsThis::add(m_noneRadio, i18n("The selected command will not be associated with any key.")); + buttonLayout->addWidget(m_noneRadio); + m_customRadio = new QRadioButton(i18n("C&ustom"), m_shortcutBox); + QWhatsThis::add(m_customRadio, + i18n("If this option is selected you can create a customized key binding for the" + " selected command using the button to the right.") ); + buttonLayout->addWidget(m_customRadio); + m_shortcutButton = new KKeyButton(m_shortcutBox); + QWhatsThis::add(m_shortcutButton, + i18n("Use this button to choose a new shortcut key. Once you click it, " + "you can press the key-combination which you would like to be assigned " + "to the currently selected command.")); + buttonLayout->addSpacing(KDialog::spacingHint() * 2); + buttonLayout->addWidget(m_shortcutButton); + connect(m_shortcutButton, SIGNAL(capturedShortcut(const KShortcut&)), + this, SLOT(shortcutChanged(const KShortcut&))); + connect(m_customRadio, SIGNAL(toggled(bool)), m_shortcutButton, SLOT(setEnabled(bool))); + connect(m_noneRadio, SIGNAL(toggled(bool)), this, SLOT(shortcutRadioToggled(bool))); + buttonLayout->addStretch(1); +} + +void CommandShortcutsModule::launchMenuEditor() +{ + if ( KApplication::startServiceByDesktopName( "kmenuedit", + QString::null /*url*/, + 0 /*error*/, + 0 /*dcopservice*/, + 0 /*pid*/, + "" /*startup_id*/, + true /*nowait*/ ) != 0 ) + { + KMessageBox::error(this, + i18n("The KDE menu editor (kmenuedit) could not be launched.\n" + "Perhaps it is not installed or not in your path."), + i18n("Application Missing")); + } +} + + +void CommandShortcutsModule::shortcutRadioToggled(bool remove) +{ + AppTreeItem *item = static_cast<AppTreeItem*>(m_tree->currentItem()); + if (!item || item->isDirectory()) + { + return; + } + + if (remove) + { + m_shortcutButton->setShortcut(QString::null, false); + item->setAccel(QString::null); + if (m_changedItems.findRef(item) == -1) + { + m_changedItems.append(item); + } + emit changed(true); + } + else + { + m_shortcutButton->captureShortcut(); + } +} + +void CommandShortcutsModule::shortcutChanged(const KShortcut& shortcut) +{ + AppTreeItem *item = static_cast<AppTreeItem*>(m_tree->currentItem()); + if (!item || item->isDirectory()) + { + return; + } + + QString accel = shortcut.toString(); + bool hasAccel = !accel.isEmpty(); + m_noneRadio->blockSignals(true); + m_noneRadio->setChecked(!hasAccel); + m_customRadio->setChecked(hasAccel); + m_shortcutButton->setShortcut(accel, false); + item->setAccel(accel); + m_noneRadio->blockSignals(false); + if (m_changedItems.findRef(item) == -1) + { + m_changedItems.append(item); + } + + emit changed( true ); +} + +void CommandShortcutsModule::showing(QWidget* w) +{ + if (w != this || treeFilled) + { + return; + } + + m_tree->fill(); + if (m_tree->firstChild()) + { + m_tree->setSelected(m_tree->firstChild(), true); + } + else + { + m_shortcutBox->setEnabled(false); + } + treeFilled = true; +} + +void CommandShortcutsModule::commandSelected(const QString& /* path */, const QString & accel, bool isDirectory) +{ + m_noneRadio->blockSignals(true); + m_shortcutBox->setEnabled(!isDirectory); + if (!isDirectory) + { + bool hasAccel = !accel.isEmpty(); + m_noneRadio->setChecked(!hasAccel); + m_customRadio->setChecked(hasAccel); + m_shortcutButton->setShortcut(accel, false); + } + m_noneRadio->blockSignals(false); +} + +void CommandShortcutsModule::commandDoubleClicked(QListViewItem *item, const QPoint &, int) +{ + if (!item) + { + return; + } + AppTreeItem *rl_item = static_cast<AppTreeItem*>(item); + if ( rl_item->isDirectory()) + return; + + m_shortcutButton->captureShortcut(); +} + +#include "commandShortcuts.moc" diff --git a/kcontrol/keys/commandShortcuts.h b/kcontrol/keys/commandShortcuts.h new file mode 100644 index 000000000..3bc492f17 --- /dev/null +++ b/kcontrol/keys/commandShortcuts.h @@ -0,0 +1,75 @@ +/* + * commandShortcuts.h + * + * Copyright (c) 2003 Aaron J. Seigo + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef __COMMAND_SHORTCUTS_MODULE_H +#define __COMMAND_SHORTCUTS_MODULE_H + +#include <qtabwidget.h> +#include <kshortcut.h> +#include <qptrlist.h> + +class AppTreeView; +class AppTreeItem; +class QButtonGroup; +class QRadioButton; +class KKeyButton; +class QListViewItem; + +typedef QPtrList<AppTreeItem> treeItemList; +typedef QPtrListIterator<AppTreeItem> treeItemListIterator; + +class CommandShortcutsModule : public QWidget +{ + Q_OBJECT + public: + CommandShortcutsModule( QWidget *parent = 0, const char *name = 0 ); + ~CommandShortcutsModule(); + + void load(); + void save(); + void defaults(); + QString quickHelp() const; + + signals: + void changed( bool ); + + public slots: + void showing(QWidget*); + + protected slots: + void commandSelected(const QString&, const QString &, bool); + void shortcutChanged(const KShortcut& shortcut); + void shortcutRadioToggled(bool remove); + void commandDoubleClicked(QListViewItem *item, const QPoint &, int); + void launchMenuEditor(); + + protected: + void initGUI(); + + private: + AppTreeView* m_tree; + QButtonGroup* m_shortcutBox; + QRadioButton* m_noneRadio; + QRadioButton* m_customRadio; + KKeyButton* m_shortcutButton; + treeItemList m_changedItems; +}; + +#endif // __COMMAND_SHORTCUTS_MODULE_H diff --git a/kcontrol/keys/convertShortcuts.pl b/kcontrol/keys/convertShortcuts.pl new file mode 100755 index 000000000..9dc216ac6 --- /dev/null +++ b/kcontrol/keys/convertShortcuts.pl @@ -0,0 +1,58 @@ +#!/usr/bin/perl +$keys=0; +foreach (<>) { + if(/^\[.*\]/) { $keys=0; } + if($keys==1) { + ($oldkey) = ($_ =~ /([^=]*)=.*/); + s/^Execute Command/Run Command/; + s/^Execute command/Run Command/; + s/^Lock screen/Lock Session/; + s/^Lock Screen/Lock Session/; + s/^Mouse emulation/Mouse Emulation/; + s/^Next keyboard layout/Switch to Next Keyboard Layout/; + s/Switch To Next Keyboard Layout/Switch to Next Keyboard Layout/; + s/^Screenshot of desktop/Desktop Screenshot/; + s/^Pop-up window operations menu/Window Operations Menu/; + s/^toggle-clipboard-actions/Enable\/Disable Clipboard Actions/; + s/^Screenshot of active window/Window Screenshot/; + s/^Show taskmanager/Show Taskmanager/; + s/^Show window list/Show Window List/; + s/^show-klipper-popupmenu/Show Klipper Popup-Menu/; + s/^Switch desktop left/Switch One Desktop to the Left/; + s/^Switch desktop right/Switch One Desktop to the Right/; + s/^Switch desktop down/Switch One Desktop Down/; + s/^Switch desktop up/Switch One Desktop Up/; + s/^Switch to desktop /Switch to Desktop /; + s/^Switch desktop next/Switch to Next Desktop/; + s/^Switch desktop previous/Switch to Previous Desktop/; + s/^Toggle Show Desktop/Toggle Showing Desktop/; + s/^Toggle raise and lower/Toggle Window Raise\/Lower/; + s/^Walk back through desktop list/Walk Through Desktop List \(Reverse\)/; + s/^Walk back through desktops/Walk Through Desktops \(Reverse\)/; + s/^Walk back through windows/Walk Through Windows \(Reverse\)/; + s/^Walk through desktop list/Walk Through Desktop List/; + s/^Walk through desktops/Walk Through Desktops/; + s/^Walk through windows/Walk Through Windows/; + s/^Window close/Window Close/; + s/^Window iconify/Window Iconify/; + s/^Window lower/Window Lower/; + s/^Window maximize/Window Maximize/; + s/^Window maximize horizontal/Window Maximize Horizontal/; + s/^Window maximize vertical/Window Maximize Vertical/; + s/^Window move/Window Move/; + s/^Window raise/Window Raise/; + s/^Window resize/Window Resize/; + s/^Window shade/Window Shade/; + s/^Window to Desktop /Window to Desktop /; + s/^Window to next desktop/Window to Next Desktop/; + s/^Window to previous desktop/Window to Previous Desktop/; + s/^repeat-last-klipper-action/Show Klipper Popup-Menu/; + ($newkey) = ($_ =~ /([^=]*)=.*/); + if ($oldkey ne $newkey) { + print "# DELETE " . $oldkey . "\n"; + print $_ + } + } + if(/\[Global Keys\]/) { $keys=1; print $_; } + if(/\[Global Shortcuts\]/) { $keys=1; print $_; } +} diff --git a/kcontrol/keys/kaccel.upd b/kcontrol/keys/kaccel.upd new file mode 100644 index 000000000..711919cdb --- /dev/null +++ b/kcontrol/keys/kaccel.upd @@ -0,0 +1,3 @@ +Id=kde3.3/r1 +File=kdeglobals +Script=convertShortcuts.pl,perl diff --git a/kcontrol/keys/kaccelaction.h b/kcontrol/keys/kaccelaction.h new file mode 100644 index 000000000..2e1f78643 --- /dev/null +++ b/kcontrol/keys/kaccelaction.h @@ -0,0 +1,205 @@ +// THIS FILE IS A COPY OF kdelibs/kdecore/kaccelaction.h AND MUST BE KEPT +// IN SYNC WITH THAT FILE. + +/* This file is part of the KDE libraries + Copyright (C) 2001,2002 Ellis Whitehead <ellis@kde.org> + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _KACCELACTION_H +#define _KACCELACTION_H + +#include <qmap.h> +#include <qptrvector.h> +#include <qstring.h> +#include <qvaluevector.h> + +#include <kshortcut.h> + +class KAccelBase; + +class QObject; +class KConfig; +class KConfigBase; + +/* + KAccelAction holds information an a given action, such as "Run Command" + + 1) KAccelAction = "Run Command" + Default3 = "Alt+F2" + Default4 = "Meta+Enter;Alt+F2" + 1) KShortcut = "Meta+Enter" + 1) KKeySequence = "Meta+Enter" + 1) KKey = "Meta+Enter" + 1) Meta+Enter + 2) Meta+Keypad_Enter + 2) KShortcut = "Alt+F2" + 1) KKeySequence = "Alt+F2" + 1) Alt+F2 + 2) KAccelAction = "Something" + Default3 = "" + Default4 = "" + 1) KShortcut = "Meta+X,Asterisk" + 1) KKeySequence = "Meta+X,Asterisk" + 1) KKey = "Meta+X" + 1) Meta+X + 2) KKey = "Asterisk" + 1) Shift+8 (English layout) + 2) Keypad_Asterisk +*/ + +//--------------------------------------------------------------------- +// KAccelAction +//--------------------------------------------------------------------- + +class KAccelAction +{ + public: + KAccelAction(); + KAccelAction( const KAccelAction& ); + KAccelAction( const QString& sName, const QString& sLabel, const QString& sWhatsThis, + const KShortcut& cutDef3, const KShortcut& cutDef4, + const QObject* pObjSlot, const char* psMethodSlot, + bool bConfigurable, bool bEnabled ); + ~KAccelAction(); + + void clear(); + bool init( const QString& sName, const QString& sLabel, const QString& sWhatsThis, + const KShortcut& cutDef3, const KShortcut& cutDef4, + const QObject* pObjSlot, const char* psMethodSlot, + bool bConfigurable, bool bEnabled ); + + KAccelAction& operator=( const KAccelAction& ); + + const QString& name() const { return m_sName; } + const QString& label() const { return m_sLabel; } + const QString& whatsThis() const { return m_sWhatsThis; } + const KShortcut& shortcut() const { return m_cut; } + const KShortcut& shortcutDefault() const; + const KShortcut& shortcutDefault3() const { return m_cutDefault3; } + const KShortcut& shortcutDefault4() const { return m_cutDefault4; } + const QObject* objSlotPtr() const { return m_pObjSlot; } + const char* methodSlotPtr() const { return m_psMethodSlot; } + bool isConfigurable() const { return m_bConfigurable; } + bool isEnabled() const { return m_bEnabled; } + + void setName( const QString& ); + void setLabel( const QString& ); + void setWhatsThis( const QString& ); + bool setShortcut( const KShortcut& rgCuts ); + void setSlot( const QObject* pObjSlot, const char* psMethodSlot ); + void setConfigurable( bool ); + void setEnabled( bool ); + + int getID() const { return m_nIDAccel; } + void setID( int n ) { m_nIDAccel = n; } + bool isConnected() const; + + bool setKeySequence( uint i, const KKeySequence& ); + void clearShortcut(); + bool contains( const KKeySequence& ); + + QString toString() const; + QString toStringInternal() const; + + static bool useFourModifierKeys(); + static void useFourModifierKeys( bool ); + + protected: + QString m_sName, + m_sLabel, + m_sWhatsThis; + KShortcut m_cut; + KShortcut m_cutDefault3, m_cutDefault4; + const QObject* m_pObjSlot; + const char* m_psMethodSlot; + bool m_bConfigurable, + m_bEnabled; + int m_nIDAccel; + uint m_nConnections; + + void incConnections(); + void decConnections(); + + private: + static int g_bUseFourModifierKeys; + class KAccelActionPrivate* d; + + friend class KAccelActions; + friend class KAccelBase; +}; + +//--------------------------------------------------------------------- +// KAccelActions +//--------------------------------------------------------------------- + +class KAccelActions +{ + public: + KAccelActions(); + KAccelActions( const KAccelActions& ); + virtual ~KAccelActions(); + + void clear(); + bool init( const KAccelActions& ); + bool init( KConfigBase& config, const QString& sGroup ); + + void updateShortcuts( KAccelActions& ); + + int actionIndex( const QString& sAction ) const; + KAccelAction* actionPtr( uint ); + const KAccelAction* actionPtr( uint ) const; + KAccelAction* actionPtr( const QString& sAction ); + const KAccelAction* actionPtr( const QString& sAction ) const; + KAccelAction* actionPtr( KKeySequence cut ); + KAccelAction& operator []( uint ); + const KAccelAction& operator []( uint ) const; + + KAccelAction* insert( const QString& sAction, const QString& sLabel, const QString& sWhatsThis, + const KShortcut& rgCutDefaults3, const KShortcut& rgCutDefaults4, + const QObject* pObjSlot = 0, const char* psMethodSlot = 0, + bool bConfigurable = true, bool bEnabled = true ); + KAccelAction* insert( const QString& sName, const QString& sLabel ); + bool remove( const QString& sAction ); + + bool readActions( const QString& sConfigGroup = "Shortcuts", KConfigBase* pConfig = 0 ); + bool writeActions( const QString& sConfigGroup = "Shortcuts", KConfigBase* pConfig = 0, + bool bWriteAll = false, bool bGlobal = false ) const; + + void emitKeycodeChanged(); + + uint count() const; + + protected: + KAccelBase* m_pKAccelBase; + KAccelAction** m_prgActions; + uint m_nSizeAllocated, m_nSize; + + void resize( uint ); + void insertPtr( KAccelAction* ); + + private: + class KAccelActionsPrivate* d; + + KAccelActions( KAccelBase* ); + void initPrivate( KAccelBase* ); + KAccelActions& operator =( KAccelActions& ); + + friend class KAccelBase; +}; + +#endif // _KACCELACTION_H diff --git a/kcontrol/keys/kde3.kksrc b/kcontrol/keys/kde3.kksrc new file mode 100644 index 000000000..b42508a78 --- /dev/null +++ b/kcontrol/keys/kde3.kksrc @@ -0,0 +1,192 @@ +[Settings] +Name=KDE Default for 3 Modifier Keys +Name[af]=Standaard KDE vir 3 verandering sleutels +Name[be]=Стандартны для KDE з трыма клавішамі мадыфікацыі +Name[bg]=KDE (с 3 модификационни клавиша) +Name[bs]=KDE standardno za 3 modifikatorske tipke +Name[ca]=Omissió KDE per a 3 tecles modificadores +Name[cs]=Výchozí pro KDE (3 modifikátory) +Name[csb]=Domëslny nastôw KDE dlô 3 klawiszów zjinaczi +Name[cy]=Rhagosodion KDE i 3 Bysell Addasu +Name[da]=KDE-standard med 3 modifikatortaster +Name[de]=KDE-Standard für 3 Sondertasten +Name[el]=Προεπιλογή KDE με 3 πλήκτρα αλλαγής +Name[eo]=KDE-defaŭlto por 3 modifaj klavoj +Name[es]=Predeterminado de KDE de 3 modificadores de teclado +Name[et]=KDE vaikeskeem 3 muuteklahviga +Name[eu]=KDE lehenetsia 3 tekla modifikatzailekin +Name[fa]=پیشفرض KDE برای ۳ کلید تغییردهندۀ +Name[fi]=KDE oletus 3:lle muokkausnäppäimelle +Name[fr]=KDE par défaut pour 3 touches de modifications +Name[fy]=KDE-standert foar 3 modifikaasjetoetsen +Name[gl]=Predeterminado de KDE para 3 Teclas Modificadoras +Name[he]=ברירת המחדל של KDE עבור 3 כפתורים +Name[hr]=KDE zadano za 3 modifikatorske tipke +Name[hu]=KDE-s alapértelmezés (3 módosító billentyűvel) +Name[is]=Sjálfgefið KDE fyrir 3 breytilykla +Name[it]=Predefinito di KDE per 3 tasti modificatori +Name[ja]=KDE 標準 (3 モディファイアキー) +Name[kk]=3 түрлендіру перне үшін KDE-нің әдетті баптауы +Name[km]=KDE លំនាំដើមសម្រាប់គ្រាប់ចុចកែប្រែ ៣ +Name[ko]=세 개의 수정자 키를 사용하는 KDE 기본값 +Name[lo]=ຄ່າປະລິຍາຍຂອງ KDE ສຳລັບປຸ່ມໃຊ້ຮ່ວມ 3 ປຸ່ມ +Name[lt]=KDE numatytoji 3 klavišams - modifikatoriams +Name[mk]=KDE-стандардно за 3 копчиња-модификатори +Name[mn]=3 сэлгүүр товчилуурын КДЭ-Стандарт +Name[ms]=Piawai KDE untuk 3 Kekunci Pengubah Suai +Name[nb]=KDE-standard for tre valgtaster +Name[nds]=KDE-Standard för 3 Sünnertasten +Name[ne]=३ परिमार्जक कुञ्जीका लागि पूर्वनिर्धारित KDE +Name[nl]=KDE-standaard voor 3 modificatietoetsen +Name[nn]=KDE-standard med tre valtastar +Name[nso]=Thuso ya Tshoganetso ya KDE ya Dinotlelo tse 3 tsa Kaonafatso +Name[pa]=3 ਮੋਡੀਫਾਇਰ ਸਵਿੱਚਾਂ ਲਈ KDE ਮੂਲ +Name[pl]=Ustawienia domyślne KDE dla 3 klawiszy modyfikatorów +Name[pt]=Predefinição do KDE para 3 Teclas Modificadoras +Name[pt_BR]=Padrão do KDE para 3 Teclas Modificadoras +Name[ro]=KDE implicit pentru 3 taste modificator +Name[ru]=KDE с тремя клавишами-модификаторами +Name[rw]=Mburabuzi KDE ya Buto 3 Muhindura +Name[se]=KDE-standárda mas leat golbma válljeboalu +Name[sk]=KDE nastavenia pre 3 modifikačné klávesy +Name[sl]=Privzeto za 3 spremenilne tipke +Name[sr]=KDE подразумевано за 3 модификаторска тастера +Name[sr@Latn]=KDE podrazumevano za 3 modifikatorska tastera +Name[sv]=KDE-förinställt med 3 väljartangenter +Name[tg]=Пешфарзи KDE барои 3 калидҳои ислоҳӣ +Name[th]=ค่าปริยายของ KDE สำหรับปุ่มเปลี่ยนหน้าที่ 3 ปุ่ม +Name[tr]=3 Değiştirici Anahtar için KDE Varsayılan +Name[tt]=KDE üzeneken, 3 Üzgärtkeç Töymä öçen +Name[uk]=Типова для KDE з 3 модифікаторами +Name[ven]=Default ya KDE ya khii tharu dzau lugisela +Name[vi]=Mặc định KDE cho 3 Phím Bổ trợ +Name[wa]=Pémetou KDE po 3 tapes di candjmints +Name[xh]=KDE Engagqibekanga ye 3 Izitsixo Mofifier +Name[zh_CN]=三个修饰键的 KDE 默认值 +Name[zh_TW]=KDE 預設使用 3 個輔助按鍵 (Alt/Ctrl/Shift) +Name[zu]=Okwendalo kwe-KDE okusetshenziselwa okhiye bokulungisa abangu-3 +Uses Win Modifier=false + +[Global Shortcuts] +Desktop Screenshot=Ctrl+Print +Enable/Disable Clipboard Actions=Alt+Ctrl+X +Run Command=Alt+F2 +Halt Computer=none +Halt without Confirmation=none +Kill Window=Alt+Ctrl+Escape +Lock Session=Alt+Ctrl+L +Logout=Alt+Ctrl+Delete +Logout without Confirmation=none +Manually Invoke Action on Current Clipboard=Alt+Ctrl+R +Mouse Emulation=Alt+F12 +Popup Launch Menu=Alt+F1 +Reboot Computer=none +Reboot without Confirmation=none +Show Klipper Popup-Menu=Alt+Ctrl+V +Show Taskmanager=Ctrl+Escape +Show Window List=Alt+F5 +Switch One Desktop Down=none +Switch One Desktop to the Left=none +Switch One Desktop to the Right=none +Switch One Desktop Up=none +Switch to Next Keyboard Layout=Alt+Ctrl+K +Switch to Desktop 1=Ctrl+F1 +Switch to Desktop 10=Ctrl+F10 +Switch to Desktop 11=Ctrl+F11 +Switch to Desktop 12=Ctrl+F12 +Switch to Desktop 13=Ctrl+Shift+F1 +Switch to Desktop 14=Ctrl+Shift+F2 +Switch to Desktop 15=Ctrl+Shift+F3 +Switch to Desktop 16=Ctrl+Shift+F4 +Switch to Desktop 2=Ctrl+F2 +Switch to Desktop 3=Ctrl+F3 +Switch to Desktop 4=Ctrl+F4 +Switch to Desktop 5=Ctrl+F5 +Switch to Desktop 6=Ctrl+F6 +Switch to Desktop 7=Ctrl+F7 +Switch to Desktop 8=Ctrl+F8 +Switch to Desktop 9=Ctrl+F9 +Switch to Next Desktop=none +Switch to Previous Desktop=none +Toggle Showing Desktop=Alt+Ctrl+D +Toggle Window Raise/Lower=none +Walk Through Desktop List=Ctrl+Tab +Walk Through Desktop List (Reverse)=Ctrl+Shift+Tab +Walk Through Desktops=none +Walk Through Desktops (Reverse)=none +Walk Through Windows=Alt+Tab +Walk Through Windows (Reverse)=Alt+Shift+Tab +Window Close=Alt+F4 +Window Iconify=none +Window Lower=none +Window Maximize=none +Window Maximize Horizontal=none +Window Maximize Vertical=none +Window Move=none +Window Operations Menu=Alt+F3 +Window Raise=none +Window Resize=none +Window Screenshot=Alt+Print +Window Shade=none +Window to Desktop 1=none +Window to Desktop 10=none +Window to Desktop 11=none +Window to Desktop 12=none +Window to Desktop 13=none +Window to Desktop 14=none +Window to Desktop 15=none +Window to Desktop 16=none +Window to Desktop 2=none +Window to Desktop 3=none +Window to Desktop 4=none +Window to Desktop 5=none +Window to Desktop 6=none +Window to Desktop 7=none +Window to Desktop 8=none +Window to Desktop 9=none +Window to Next Desktop=none +Window to Previous Desktop=none + +[Shortcuts] +AddBookmark=Ctrl+B +Back=Alt+Left +Close=Ctrl+W +Copy=Ctrl+C;Ctrl+Insert +Cut=Ctrl+X;Shift+Delete +DeleteWordBack=Ctrl+Backspace +DeleteWordForward=Ctrl+Delete +Deselect=Ctrl+Shift+A +End=Ctrl+End +Find=Ctrl+F +FindNext=F3 +FindPrev=Shift+F3 +Forward=Alt+Right +GotoLine=Ctrl+G +Help=F1 +Home=Ctrl+Home +Insert=Ctrl+Insert +New=Ctrl+N +Next=Next +NextCompletion=Ctrl+Down +Open=Ctrl+O +Paste=Ctrl+V;Shift+Insert +PopupMenuContext=Menu +PrevCompletion=Ctrl+Up +Print=Ctrl+P +Prior=Prior +Quit=Ctrl+Q +Redo=Ctrl+Shift+Z +Reload=F5 +Replace=Ctrl+R +RotateDown=Down +RotateUp=Up +Save=Ctrl+S +SelectAll=Ctrl+A +ShowMenubar=Ctrl+M +SubstringCompletion=Ctrl+T +TextCompletion=Ctrl+E +Undo=Ctrl+Z +Up=Alt+Up +WhatsThis=Shift+F1 +ZoomIn=Ctrl+Plus +ZoomOut=Ctrl+Minus diff --git a/kcontrol/keys/kde4.kksrc b/kcontrol/keys/kde4.kksrc new file mode 100644 index 000000000..367bc41d6 --- /dev/null +++ b/kcontrol/keys/kde4.kksrc @@ -0,0 +1,192 @@ +[Settings] +Name=KDE Default for 4 Modifier Keys +Name[af]=Standaard KDE vir 4 verandering sleutels +Name[be]=Стандартны для KDE з чатырма клавішамі мадыфікацыі +Name[bg]=KDE (с 4 модификационни клавиша) +Name[bs]=KDE standardno za 4 modifikatorske tipke +Name[ca]=Omissió KDE per a 4 tecles modificadores +Name[cs]=Výchozí pro KDE (4 modifikátory) +Name[csb]=Domëslny nastôw KDE dlô 4 klawiszów zjinaczi +Name[cy]=Rhagosodion KDE i 4 Bysell Addasu +Name[da]=KDE-standard med 4 modifikatortaster +Name[de]=KDE-Standard für 4 Sondertasten +Name[el]=Προεπιλογή KDE με 4 πλήκτρα αλλαγής +Name[eo]=KDE-defaŭlto por 4 modifaj klavoj +Name[es]=Predeterminado de KDE de 4 modificadores de teclado +Name[et]=KDE vaikeskeem 4 muuteklahviga +Name[eu]=KDE lehenetsia 4 tekla modifikatzailekin +Name[fa]=پیشفرض KDE برای ۴ کلید تغییردهندۀ +Name[fi]=KDE oletus 4:lle muokkausnäppäimelle +Name[fr]=KDE par défaut pour 4 touches de modifications +Name[fy]=KDE-standert foar 4 modifikaasjetoetsen +Name[gl]=Predeterminado de KDE para 4 Teclas Modificadoras +Name[he]=ברירת המחדל של KDE עבור 4 כפתורים +Name[hr]=KDE zadano za 4 modifikatorske tipke +Name[hu]=KDE-s alapértelmezés (4 módosító billentyűvel) +Name[is]=Sjálfgefið KDE fyrir 4 breytilykla +Name[it]=Predefinito di KDE per 4 tasti modificatori +Name[ja]=KDE 標準 (4 モディファイアキー) +Name[kk]=4 түрлендіру перне үшін KDE-нің әдетті баптауы +Name[km]=KDE លំនាំដើមសម្រាប់គ្រាប់ចុចកែប្រែ ៤ +Name[ko]=네 개의 수정자 키를 사용하는 KDE 기본값 +Name[lo]=ຄ່າປະລິຍາຍຂອງ KDE ສຳລັບປຸ່ມໃຊ້ຮ່ວມ 4 ປຸ່່ມ +Name[lt]=KDE numatytoji 4 klavišams - modifikatoriams +Name[mk]=KDE-стандардно за 4 копчиња-модификатори +Name[mn]=4 сэлгүүр товчилуурын КДЭ-Стандарт +Name[ms]=Piawai KDE untuk 4 Kekunci Pengubah Suai +Name[nb]=KDE-standard for fire valgtaster +Name[nds]=KDE-Standard för 4 Sünnertasten +Name[ne]=४ परिमार्जक कुञ्जीका लागि पूर्वनिर्धारित KDE +Name[nl]=KDE-standaard voor 4 modificatietoetsen +Name[nn]=KDE-standard med fire valtastar +Name[nso]=Thuso ya Tshoganetso ya KDE ya Dinotlelo tse 4 tsa Kaonafatso +Name[pa]=4 ਮੋਡੀਫਾਇਰ ਸਵਿੱਚਾਂ ਲਈ KDE ਮੂਲ +Name[pl]=Ustawienia domyślne KDE dla 4 klawiszy modyfikatorów +Name[pt]=Predefinição do KDE para 4 Teclas Modificadoras +Name[pt_BR]=Padrão do KDE para 4 Teclas Modificadoras +Name[ro]=KDE implicit pentru 4 taste modificator +Name[ru]=KDE с четырьмя клавишами-модификаторами +Name[rw]=Mburabuzi KDE ya Buto 4 Muhindura +Name[se]=KDE-standárda mas leat njeallje válljenboalu +Name[sk]=KDE nastavenia pre 4 modifikačné klávesy +Name[sl]=Privzeto za 4 spremenilne tipke +Name[sr]=KDE подразумевано за 4 модификаторска тастера +Name[sr@Latn]=KDE podrazumevano za 4 modifikatorska tastera +Name[sv]=KDE-förinställt med 4 väljartangenter +Name[tg]=Пешфарзи KDE барои 4 калидҳои ислоҳӣ +Name[th]=ค่าปริยายของ KDE สำหรับปุ่มเปลี่ยนหน้าที่ 4 ปุ่ม +Name[tr]=4 Değiştirici Anahtar için KDE Varsayılan +Name[tt]=KDE üzeneken, 4 Üzgärtkeç Töymä öçen +Name[uk]=Типова для KDE з 4 модифікаторами +Name[ven]=Default ya KDE ya khii nna dzau lugisela +Name[vi]=Mặc định KDE cho 4 Phím Bổ trợ +Name[wa]=Pémetou KDE po 4 tapes di candjmints +Name[xh]=KDE Engagqibekanga ye 4 Izitsixo Mofifier +Name[zh_CN]=四个修饰键的 KDE 默认值 +Name[zh_TW]=KDE 預設使用 4 個輔助按鍵 (Meta/Alt/Ctrl/Shift) +Name[zu]=Okwendalo kwe-KDE okusetshenziselwa okhiye bokulungisa abangu-4 +Uses Win Modifier=true + +[Global Shortcuts] +Desktop Screenshot=Win+Print +Enable/Disable Clipboard Actions=Win+Ctrl+X +Run Command=Win+Return;Alt+F2 +Halt Computer=none +Halt without Confirmation=none +Kill Window=Win+Ctrl+Delete +Lock Session=Win+ScrollLock +Logout=Win+Escape +Logout without Confirmation=none +Manually Invoke Action on Current Clipboard=Win+Ctrl+R +Mouse Emulation=none +Popup Launch Menu=Win+Menu +Reboot Computer=none +Reboot without Confirmation=none +Show Klipper Popup-Menu=Win+Ctrl+V +Show Taskmanager=Win+Ctrl+Pause +Show Window List=Win+0 +Switch One Desktop Down=none +Switch One Desktop to the Left=none +Switch One Desktop to the Right=none +Switch One Desktop Up=none +Switch to Next Keyboard Layout=Win+Ctrl+K +Switch to Desktop 1=Win+F1 +Switch to Desktop 10=Win+F10 +Switch to Desktop 11=none +Switch to Desktop 12=none +Switch to Desktop 13=none +Switch to Desktop 14=none +Switch to Desktop 15=none +Switch to Desktop 16=none +Switch to Desktop 2=Win+F2 +Switch to Desktop 3=Win+F3 +Switch to Desktop 4=Win+F4 +Switch to Desktop 5=Win+F5 +Switch to Desktop 6=Win+F6 +Switch to Desktop 7=Win+F7 +Switch to Desktop 8=Win+F8 +Switch to Desktop 9=Win+F9 +Switch to Next Desktop=none +Switch to Previous Desktop=none +Toggle Showing Desktop=Win+Ctrl+D +Toggle Window Raise/Lower=none +Walk Through Desktop List=none +Walk Through Desktop List (Reverse)=none +Walk Through Desktops=Win+Tab +Walk Through Desktops (Reverse)=Win+Shift+Tab +Walk Through Windows=Alt+Tab +Walk Through Windows (Reverse)=Alt+Shift+Tab +Window Close=Alt+Escape;Alt+F4 +Window Iconify=Win+Minus +Window Lower=none +Window Maximize=Win+Plus +Window Maximize Horizontal=Win+Equal +Window Maximize Vertical=Win+Bar +Window Move=none +Window Operations Menu=Alt+Menu +Window Raise=none +Window Resize=none +Window Screenshot=Alt+Print +Window Shade=Win+Underscore +Window to Desktop 1=Win+Alt+F1 +Window to Desktop 10=Win+Alt+F10 +Window to Desktop 11=none +Window to Desktop 12=none +Window to Desktop 13=none +Window to Desktop 14=none +Window to Desktop 15=none +Window to Desktop 16=none +Window to Desktop 2=Win+Alt+F2 +Window to Desktop 3=Win+Alt+F3 +Window to Desktop 4=Win+Alt+F4 +Window to Desktop 5=Win+Alt+F5 +Window to Desktop 6=Win+Alt+F6 +Window to Desktop 7=Win+Alt+F7 +Window to Desktop 8=Win+Alt+F8 +Window to Desktop 9=Win+Alt+F9 +Window to Next Desktop=none +Window to Previous Desktop=none + +[Shortcuts] +AddBookmark=Ctrl+B +Back=Alt+Left +Close=Ctrl+Escape;Ctrl+W +Copy=Ctrl+C;Ctrl+Insert +Cut=Ctrl+X;Shift+Delete +DeleteWordBack=Ctrl+Backspace +DeleteWordForward=Ctrl+Delete +Deselect=Ctrl+Shift+A +End=Ctrl+End +Find=Ctrl+F +FindNext=F3 +FindPrev=Shift+F3 +Forward=Alt+Right +GotoLine=Ctrl+G +Help=F1 +Home=Ctrl+Home +Insert=Ctrl+Insert +New=Ctrl+N +Next=Next +NextCompletion=Ctrl+Down +Open=Ctrl+O +Paste=Ctrl+V;Shift+Insert +PopupMenuContext=Menu +PrevCompletion=Ctrl+Up +Print=Ctrl+P +Prior=Prior +Quit=Ctrl+Q +Redo=Ctrl+Shift+Z +Reload=F5 +Replace=Ctrl+R +RotateDown=Down +RotateUp=Up +Save=Ctrl+S +SelectAll=Ctrl+A +ShowMenubar=Ctrl+M +SubstringCompletion=Ctrl+T +TextCompletion=Ctrl+E +Undo=Ctrl+Z +Up=Alt+Up +WhatsThis=Shift+F1 +ZoomIn=Ctrl+Plus +ZoomOut=Ctrl+Minus diff --git a/kcontrol/keys/keyconfig.cpp b/kcontrol/keys/keyconfig.cpp new file mode 100644 index 000000000..89a32cf5e --- /dev/null +++ b/kcontrol/keys/keyconfig.cpp @@ -0,0 +1,545 @@ +// +// KDE Shortcut config module +// +// Copyright (c) Mark Donohoe 1998 +// Copyright (c) Matthias Ettrich 1998 +// Converted to generic key configuration module, Duncan Haldane 1998. +// Layout fixes copyright (c) 2000 Preston Brown <pbrown@kde.org> + +#include <config.h> +#include <stdlib.h> + +#include <unistd.h> + +#include <qlabel.h> +#include <qdir.h> +#include <qlayout.h> +#include <qwhatsthis.h> +#include <qcheckbox.h> +#include <qregexp.h> + +#include <kdebug.h> +#include <klocale.h> +#include <kstandarddirs.h> +#include <ksimpleconfig.h> +#include <kmessagebox.h> +#include <kseparator.h> +#include <dcopclient.h> +#include <kapplication.h> +#include <kkey_x11.h> // Used in KKeyModule::init() + +#include "keyconfig.h" +#include "keyconfig.moc" + +#define KICKER_ALL_BINDINGS + +//---------------------------------------------------------------------------- + +KKeyModule::KKeyModule( QWidget *parent, bool isGlobal, bool bSeriesOnly, bool bSeriesNone, const char *name ) + : QWidget( parent, name ) +{ + init( isGlobal, bSeriesOnly, bSeriesNone ); +} + +KKeyModule::KKeyModule( QWidget *parent, bool isGlobal, const char *name ) + : QWidget( parent, name ) +{ + init( isGlobal, false, false ); +} + +void KKeyModule::init( bool isGlobal, bool _bSeriesOnly, bool bSeriesNone ) +{ + QString wtstr; + + KeyType = isGlobal ? "global" : "standard"; + + bSeriesOnly = _bSeriesOnly; + + kdDebug(125) << "KKeyModule::init() - Get default key bindings." << endl; + if ( KeyType == "global" ) { + KAccelActions* keys = &actions; +// see also KKeyModule::init() below !!! +#define NOSLOTS +#define KShortcuts KAccelShortcuts +#include "../../kwin/kwinbindings.cpp" +#include "../../kicker/kicker/core/kickerbindings.cpp" +#include "../../kicker/taskbar/taskbarbindings.cpp" +#include "../../kdesktop/kdesktopbindings.cpp" +#include "../../klipper/klipperbindings.cpp" +#include "../../kxkb/kxkbbindings.cpp" +#undef KShortcuts + KeyScheme = "Global Key Scheme"; + KeySet = "Global Keys"; + // Sorting Hack: I'll re-write the module once feature-adding begins again. + if( bSeriesOnly || bSeriesNone ) { + for( uint i = 0; i < actions.size(); i++ ) { + QString sConfigKey = actions[i].m_sName; + //kdDebug(125) << "sConfigKey: " << sConfigKey << endl; + int iLastSpace = sConfigKey.findRev( ' ' ); + bool bIsNum = false; + if( iLastSpace >= 0 ) + sConfigKey.mid( iLastSpace+1 ).toInt( &bIsNum ); + + kdDebug(125) << "sConfigKey: " << sConfigKey + << " bIsNum: " << bIsNum + << " bSeriesOnly: " << bSeriesOnly << endl; + if( ((bSeriesOnly && !bIsNum) || (bSeriesNone && bIsNum)) && !sConfigKey.contains( ':' ) ) { + actions.removeAction( sConfigKey ); + i--; + } + } + } + } + + if ( KeyType == "standard" ) { + for(uint i=0; i<KStdAccel::NB_STD_ACCELS; i++) { + KStdAccel::StdAccel id = (KStdAccel::StdAccel)i; + actions.insertAction( KStdAccel::action(id), + KStdAccel::description(id), + KStdAccel::defaultKey3(id), + KStdAccel::defaultKey4(id) ); + } + + KeyScheme = "Standard Key Scheme"; + KeySet = "Keys"; + } + + //kdDebug(125) << "KKeyModule::init() - Read current key bindings from config." << endl; + //actions.readActions( KeySet ); + + sFileList = new QStringList(); + sList = new QListBox( this ); + + //readSchemeNames(); + sList->setCurrentItem( 0 ); + connect( sList, SIGNAL( highlighted( int ) ), + SLOT( slotPreviewScheme( int ) ) ); + + QLabel *label = new QLabel( sList, i18n("&Key Scheme"), this ); + + wtstr = i18n("Here you can see a list of the existing key binding schemes with 'Current scheme'" + " referring to the settings you are using right now. Select a scheme to use, remove or" + " change it."); + QWhatsThis::add( label, wtstr ); + QWhatsThis::add( sList, wtstr ); + + addBt = new QPushButton( i18n("&Save Scheme..."), this ); + connect( addBt, SIGNAL( clicked() ), SLOT( slotAdd() ) ); + QWhatsThis::add(addBt, i18n("Click here to add a new key bindings scheme. You will be prompted for a name.")); + + removeBt = new QPushButton( i18n("&Remove Scheme"), this ); + removeBt->setEnabled(FALSE); + connect( removeBt, SIGNAL( clicked() ), SLOT( slotRemove() ) ); + QWhatsThis::add( removeBt, i18n("Click here to remove the selected key bindings scheme. You can not" + " remove the standard system wide schemes, 'Current scheme' and 'KDE default'.") ); + + // Hack to get this setting only displayed once. It belongs in main.cpp instead. + // That move will take a lot of UI redesigning, though, so i'll do it once CVS + // opens up for feature commits again. -- ellis + /* Needed to remove because this depended upon non-BC changes in KeyEntry.*/ + // If this is the "Global Keys" section of the KDE Control Center: + if( isGlobal && !bSeriesOnly ) { + preferMetaBt = new QCheckBox( i18n("Prefer 4-modifier defaults"), this ); + if( !KKeySequence::keyboardHasMetaKey() ) + preferMetaBt->setEnabled( false ); + preferMetaBt->setChecked( KKeySequence::useFourModifierKeys() ); + connect( preferMetaBt, SIGNAL(clicked()), SLOT(slotPreferMeta()) ); + QWhatsThis::add( preferMetaBt, i18n("If your keyboard has a Meta key, but you would " + "like KDE to prefer the 3-modifier configuration defaults, then this option " + "should be unchecked.") ); + } else + preferMetaBt = 0; + + KSeparator* line = new KSeparator( KSeparator::HLine, this ); + + kc = new KeyChooserSpec( actions, this, isGlobal ); + connect( kc, SIGNAL(keyChange()), this, SLOT(slotKeyChange()) ); + + readScheme(); + + QGridLayout *topLayout = new QGridLayout( this, 6, 2, + KDialog::marginHint(), + KDialog::spacingHint()); + topLayout->addWidget(label, 0, 0); + topLayout->addMultiCellWidget(sList, 1, 2, 0, 0); + topLayout->addWidget(addBt, 1, 1); + topLayout->addWidget(removeBt, 2, 1); + if( preferMetaBt ) + topLayout->addWidget(preferMetaBt, 3, 0); + topLayout->addMultiCellWidget(line, 4, 4, 0, 1); + topLayout->addRowSpacing(3, 15); + topLayout->addMultiCellWidget(kc, 5, 5, 0, 1); + + setMinimumSize(topLayout->sizeHint()); +} + +KKeyModule::~KKeyModule (){ + //kdDebug() << "KKeyModule destructor" << endl; + delete kc; + delete sFileList; +} + +bool KKeyModule::writeSettings( const QString& sGroup, KConfig* pConfig ) +{ + kc->commitChanges(); + actions.writeActions( sGroup, pConfig, true, false ); + return true; +} + +bool KKeyModule::writeSettingsGlobal( const QString& sGroup ) +{ + kc->commitChanges(); + actions.writeActions( sGroup, 0, true, true ); + return true; +} + +void KKeyModule::load() +{ + kc->listSync(); +} + +/*void KKeyModule::save() +{ + if( preferMetaBt ) + KKeySequence::useFourModifierKeys( preferMetaBt->isChecked() ); + + kc->commitChanges(); + actions.writeActions( KeySet, 0, true, true ); + if ( KeyType == "global" ) { + if ( !kapp->dcopClient()->isAttached() ) + kapp->dcopClient()->attach(); + // TODO: create a reconfigureKeys() method. + kapp->dcopClient()->send("kwin", "", "reconfigure()", ""); + kapp->dcopClient()->send("kdesktop", "", "configure()", ""); + kapp->dcopClient()->send("kicker", "Panel", "configure()", ""); + } +}*/ + +void KKeyModule::defaults() +{ + if( preferMetaBt ) + preferMetaBt->setChecked( false ); + KKeySequence::useFourModifierKeys( false ); + kc->allDefault(); +} + +/*void KKeyModule::slotRemove() +{ + QString kksPath = + KGlobal::dirs()->saveLocation("data", "kcmkeys/" + KeyType); + + QDir d( kksPath ); + if (!d.exists()) // what can we do? + return; + + d.setFilter( QDir::Files ); + d.setSorting( QDir::Name ); + d.setNameFilter("*.kksrc"); + + uint ind = sList->currentItem(); + + if ( !d.remove( *sFileList->at( ind ) ) ) { + KMessageBox::sorry( 0, + i18n("This key scheme could not be removed.\n" + "Perhaps you do not have permission to alter the file " + "system where the key scheme is stored." )); + return; + } + + sList->removeItem( ind ); + sFileList->remove( sFileList->at(ind) ); +}*/ + +void KKeyModule::slotKeyChange() +{ + emit keyChange(); + //emit keysChanged( &dict ); +} + +/*void KKeyModule::slotSave( ) +{ + KSimpleConfig config(*sFileList->at( sList->currentItem() ) ); + // global=true is necessary in order to + // let both 'Global Shortcuts' and 'Shortcut Sequences' be + // written to the same scheme file. + kc->commitChanges(); + actions.writeActions( KeyScheme, &config, KeyType == "global", KeyType == "global" ); +}*/ + +void KKeyModule::slotPreferMeta() +{ + kc->setPreferFourModifierKeys( preferMetaBt->isChecked() ); +} + +void KKeyModule::readScheme( int index ) +{ + kdDebug(125) << "readScheme( " << index << " )\n"; + if( index == 1 ) + kc->allDefault( false ); + //else if( index == 2 ) + // kc->allDefault( true ); + else { + KConfigBase* config = 0; + if( index == 0 ) config = new KConfig( "kdeglobals" ); + //else config = new KSimpleConfig( *sFileList->at( index ), true ); + + actions.readActions( (index == 0) ? KeySet : KeyScheme, config ); + kc->listSync(); + delete config; + } +} + +/*void KKeyModule::slotAdd() +{ + QString sName; + + if ( sList->currentItem() >= nSysSchemes ) + sName = sList->currentText(); + SaveScm ss( 0, "save scheme", sName ); + + bool nameValid; + QString sFile; + int exists = -1; + + do { + + nameValid = TRUE; + + if ( ss.exec() ) { + sName = ss.nameLine->text(); + if ( sName.stripWhiteSpace().isEmpty() ) + return; + + sName = sName.simplifyWhiteSpace(); + sFile = sName; + + int ind = 0; + while ( ind < (int) sFile.length() ) { + + // parse the string for first white space + + ind = sFile.find(" "); + if (ind == -1) { + ind = sFile.length(); + break; + } + + // remove from string + + sFile.remove( ind, 1); + + // Make the next letter upper case + + QString s = sFile.mid( ind, 1 ); + s = s.upper(); + sFile.replace( ind, 1, s ); + + } + + exists = -1; + for ( int i = 0; i < (int) sList->count(); i++ ) { + if ( sName.lower() == (sList->text(i)).lower() ) { + exists = i; + + int result = KMessageBox::warningContinueCancel( 0, + i18n("A key scheme with the name '%1' already exists.\n" + "Do you want to overwrite it?\n").arg(sName), + i18n("Save Key Scheme"), + i18n("Overwrite")); + if (result == KMessageBox::Continue) + nameValid = true; + else + nameValid = false; + } + } + } else return; + + } while ( nameValid == FALSE ); + + disconnect( sList, SIGNAL( highlighted( int ) ), this, + SLOT( slotPreviewScheme( int ) ) ); + + + QString kksPath = KGlobal::dirs()->saveLocation("data", "kcmkeys/"); + + QDir d( kksPath ); + if ( !d.exists() ) + if ( !d.mkdir( kksPath ) ) { + qWarning("KKeyModule: Could not make directory to store user info."); + return; + } + + kksPath += KeyType ; + kksPath += "/"; + + d.setPath( kksPath ); + if ( !d.exists() ) + if ( !d.mkdir( kksPath ) ) { + qWarning("KKeyModule: Could not make directory to store user info."); + return; + } + + sFile.prepend( kksPath ); + sFile += ".kksrc"; + if (exists == -1) + { + sList->insertItem( sName ); + sList->setFocus(); + sList->setCurrentItem( sList->count()-1 ); + sFileList->append( sFile ); + } + else + { + sList->setFocus(); + sList->setCurrentItem( exists ); + } + + KSimpleConfig *config = + new KSimpleConfig( sFile ); + + config->setGroup( KeyScheme ); + config->writeEntry( "Name", sName ); + delete config; + + slotSave(); + + connect( sList, SIGNAL( highlighted( int ) ), this, + SLOT( slotPreviewScheme( int ) ) ); + + slotPreviewScheme( sList->currentItem() ); +}*/ + +/*void KKeyModule::slotPreviewScheme( int indx ) +{ + readScheme( indx ); + + // Set various appropriate for the scheme + + if ( indx < nSysSchemes || + (*sFileList->at(indx)).contains( "/global-" ) || + (*sFileList->at(indx)).contains( "/app-" ) ) { + removeBt->setEnabled( FALSE ); + } else { + removeBt->setEnabled( TRUE ); + } +}*/ + +/*void KKeyModule::readSchemeNames( ) +{ + QStringList schemes = KGlobal::dirs()->findAllResources("data", "kcmkeys/" + KeyType + "/*.kksrc"); + //QRegExp r( "-kde[34].kksrc$" ); + QRegExp r( "-kde3.kksrc$" ); + + sList->clear(); + sFileList->clear(); + sList->insertItem( i18n("Current Scheme"), 0 ); + sFileList->append( "Not a kcsrc file" ); + sList->insertItem( i18n("KDE Traditional"), 1 ); + sFileList->append( "Not a kcsrc file" ); + //sList->insertItem( i18n("KDE Extended (With 'Win' Key)"), 2 ); + //sList->insertItem( i18n("KDE Default for 4 Modifiers (Meta/Alt/Ctrl/Shift)"), 2 ); + //sFileList->append( "Not a kcsrc file" ); + nSysSchemes = 2; + + // This for system files + for ( QStringList::ConstIterator it = schemes.begin(); it != schemes.end(); ++it) { + // KPersonalizer relies on .kksrc files containing all the keyboard shortcut + // schemes for various setups. It also requires the KDE defaults to be in + // a .kksrc file. The KDE defaults shouldn't be listed here. + //if( r.search( *it ) != -1 ) + // continue; + + KSimpleConfig config( *it, true ); + // TODO: Put 'Name' in "Settings" group + config.setGroup( KeyScheme ); + QString str = config.readEntry( "Name" ); + + sList->insertItem( str ); + sFileList->append( *it ); + } +}*/ + +/*void KKeyModule::updateKeys( const KAccelActions* map_P ) + { + kc->updateKeys( map_P ); + }*/ + +// write all the global keys to kdeglobals +// this is needed to be able to check for conflicts with global keys in app's keyconfig +// dialogs, kdeglobals is empty as long as you don't apply any change in controlcenter/keys +void KKeyModule::init() +{ + kdDebug(125) << "KKeyModule::init()\n"; + + /*kdDebug(125) << "KKeyModule::init() - Initialize # Modifier Keys Settings\n"; + KConfigGroupSaver cgs( KGlobal::config(), "Keyboard" ); + QString fourMods = KGlobal::config()->readEntry( "Use Four Modifier Keys", KAccel::keyboardHasMetaKey() ? "true" : "false" ); + KAccel::useFourModifierKeys( fourMods == "true" ); + bool bUseFourModifierKeys = KAccel::useFourModifierKeys(); + KGlobal::config()->writeEntry( "User Four Modifier Keys", bUseFourModifierKeys ? "true" : "false", true, true ); + */ + KAccelActions* keys = new KAccelActions(); + + kdDebug(125) << "KKeyModule::init() - Load Included Bindings\n"; +// this should match the included files above +#define NOSLOTS +#define KShortcuts KAccelShortcuts +#include "../../klipper/klipperbindings.cpp" +#include "../../kwin/kwinbindings.cpp" +#include "../../kicker/kicker/core/kickerbindings.cpp" +#include "../../kicker/taskbar/taskbarbindings.cpp" +#include "../../kdesktop/kdesktopbindings.cpp" +#include "../../kxkb/kxkbbindings.cpp" +#undef KShortcuts + + kdDebug(125) << "KKeyModule::init() - Read Config Bindings\n"; + keys->readActions( "Global Keys" ); + + { + KSimpleConfig cfg( "kdeglobals" ); + cfg.deleteGroup( "Global Keys" ); + } + + kdDebug(125) << "KKeyModule::init() - Write Config Bindings\n"; + keys->writeActions( "Global Keys", 0, true, true ); +} + +//----------------------------------------------------------------- +// KeyChooserSpec +//----------------------------------------------------------------- + +KeyChooserSpec::KeyChooserSpec( KAccelActions& actions, QWidget* parent, bool bGlobal ) + : KKeyChooser( actions, parent, bGlobal, false, true ), m_bGlobal( bGlobal ) + { + //if( global ) + // globalDict()->clear(); // don't check against global keys twice + } + +/*void KeyChooserSpec::updateKeys( const KAccelActions* map_P ) + { + if( global ) + { + stdDict()->clear(); + for( KAccelActions::ConstIterator gIt( map_P->begin()); + gIt != map_P->end(); + ++gIt ) + { + int* keyCode = new int; + *keyCode = ( *gIt ).aConfigKeyCode; + stdDict()->insert( gIt.key(), keyCode); + } + } + else + { + globalDict()->clear(); + for( KAccelActions::ConstIterator gIt( map_P->begin()); + gIt != map_P->end(); + ++gIt ) + { + int* keyCode = new int; + *keyCode = ( *gIt ).aConfigKeyCode; + globalDict()->insert( gIt.key(), keyCode); + } + } + } +*/ diff --git a/kcontrol/keys/keyconfig.h b/kcontrol/keys/keyconfig.h new file mode 100644 index 000000000..cba853e4d --- /dev/null +++ b/kcontrol/keys/keyconfig.h @@ -0,0 +1,90 @@ +// +// KDE Shortcut config module +// +// Copyright (c) Mark Donohoe 1998 +// Copyright (c) Matthias Ettrich 1998 +// Converted to generic key configuration module, Duncan Haldane 1998. + +#ifndef __KEYCONFIG_H__ +#define __KEYCONFIG_H__ + +#include <qpushbutton.h> +#include <qlistbox.h> + +#include <kaccel.h> +#include <kkeydialog.h> +//#include <kcmodule.h> +#include <qdict.h> + +class QCheckBox; + +class KeyChooserSpec; + +class KKeyModule : public QWidget +{ + Q_OBJECT +public: + KAccelActions actions; + //KAccelActions dict; + KeyChooserSpec *kc; + + KKeyModule( QWidget *parent, bool isGlobal, bool bSeriesOnly, bool bSeriesNone, const char *name = 0 ); + KKeyModule( QWidget *parent, bool isGlobal, const char *name = 0 ); + ~KKeyModule (); + +protected: + void init( bool isGlobal, bool bSeriesOnly, bool bSeriesNone ); + +public: + virtual void load(); + //virtual void save(); + virtual void defaults(); + static void init(); + + bool writeSettings( const QString& sGroup, KConfig* pConfig ); + bool writeSettingsGlobal( const QString& sGroup ); + +public slots: + //void slotPreviewScheme( int ); + //void slotAdd(); + //void slotSave(); + //void slotRemove(); + void slotKeyChange(); + void slotPreferMeta(); + //void updateKeys( const KAccelActions* map_P ); + //void readSchemeNames(); + +signals: + void keyChange(); + //void keysChanged( const KAccelActions* map_P ); + +protected: + QListBox *sList; + QStringList *sFileList; + QPushButton *addBt; + QPushButton *removeBt; + QCheckBox *preferMetaBt; + int nSysSchemes; + bool bSeriesOnly; + + void readScheme( int index=0 ); + + QString KeyType; + QString KeyScheme; + QString KeySet; + +}; + +class KeyChooserSpec : public KKeyChooser +{ + Q_OBJECT +public: + KeyChooserSpec( KAccelActions& actions, QWidget* parent, + bool bGlobal ); + //void updateKeys( const KAccelActions* map_P ); +protected: + bool m_bGlobal; +}; + +#endif + diff --git a/kcontrol/keys/keys.desktop b/kcontrol/keys/keys.desktop new file mode 100644 index 000000000..b39bab385 --- /dev/null +++ b/kcontrol/keys/keys.desktop @@ -0,0 +1,239 @@ +[Desktop Entry] +Exec=kcmshell keys +Icon=key_bindings +Type=Application +DocPath=kcontrol/keys/index.html + + +X-KDE-Library=keys +X-KDE-Init=keys +X-KDE-ParentApp=kcontrol + +Name=Keyboard Shortcuts +Name[af]=Sleutelbord Kortpaaie +Name[ar]=إختصارات لوحة المفاتيح +Name[az]=Klaviatura Qısa Yolları +Name[be]=Клавіятурныя скароты +Name[bg]=Бързи клавиши +Name[bn]=কীবোর্ড শর্টকাট +Name[br]=Berradennoù ar stokellaoueg +Name[bs]=Prečice tastature +Name[ca]=Dreceres de teclat +Name[cs]=Klávesové zkratky +Name[csb]=Klawiszowé skrodzënë +Name[cy]=Llwybrau Byr Bysellfwrdd +Name[da]=Tastaturgenveje +Name[de]=Tastenkürzel +Name[el]=Συντομεύσεις πληκτρολογίου +Name[eo]=Klavkombinoj +Name[es]=Accesos rápidos de teclado +Name[et]=Kiirklahvid +Name[eu]=Laster-teklak +Name[fa]=میانبرهای صفحه کلید +Name[fi]=Näppäimistön pikavalinnat +Name[fr]=Raccourcis clavier +Name[fy]=Fluchtoetsen +Name[ga]=Aicearraí Méarchláir +Name[gl]=Atallos de Teclado +Name[he]=קיצורי מקשים +Name[hi]=कुंजीपट शॉर्टकट +Name[hr]=Prečaci tipkovnice +Name[hu]=Billentyűparancsok +Name[is]=Flýtilyklar +Name[it]=Scorciatoie della tastiera +Name[ja]=キーボードショートカット +Name[ka]=კლავიშების მალსახმობი +Name[kk]=Перне тіркесімдер +Name[km]=ផ្លូវកាត់ក្ដារចុច +Name[ko]=키보드 단축키 +Name[lo]=ການຈັດວາງແປ້ນພິມ +Name[lt]=Spartieji klavišai +Name[lv]=Tastatūras saīsnes +Name[mk]=Кратенки на тастатурата +Name[mn]=Гарын богино товчилуур +Name[ms]=Jalan Pintas Papan Kekunci +Name[mt]=Taqsiriet tat-tastiera +Name[nb]=Hurtigtaster +Name[nds]=Tastkombinatschonen +Name[ne]=कुञ्जीपाटी सर्टकट +Name[nl]=Sneltoetsen +Name[nn]=Snøggtastar +Name[nso]=Ditselakopana tsa Keyboard +Name[pa]=ਕੀ-ਬੋਰਡ ਸ਼ਾਰਟਕੱਟ +Name[pl]=Skróty klawiszowe +Name[pt]=Atalhos do Teclado +Name[pt_BR]=Atalhos de teclado +Name[ro]=Acceleratori de tastatură +Name[ru]=Комбинации клавиш +Name[rw]=Amahinanzira ya Mwandikisho +Name[se]=Jođánisboalut +Name[sk]=Klávesové skratky +Name[sl]=Bližnjice na tipkovnici +Name[sr]=Пречице са тастатуре +Name[sr@Latn]=Prečice sa tastature +Name[sv]=Snabbtangenter +Name[ta]=விசைப்பலகை குறுக்கு வழிகள் +Name[te]=కీబొర్డ్ శీఘ్రమార్గాలు +Name[tg]=Забонаки кнопкаҳои тез +Name[th]=ปุ่มพิมพ์ลัด +Name[tr]=Klavye Kısayolları +Name[tt]=Töylek Qısqartmaları +Name[uk]=Скорочення клавіатури +Name[uz]=Tugmalar birikmasi +Name[uz@cyrillic]=Тугмалар бирикмаси +Name[ven]=Tshikhau tsha khiibodo +Name[vi]=Gõ tắt trên Bàn phím +Name[wa]=Rascourtis taprece +Name[xh]=Indlela ezimfutshane Zebhodi yezitshixo +Name[zh_CN]=键盘快捷键 +Name[zh_TW]=鍵盤捷徑 +Name[zu]=Izindlela Ezimfushane zebhodi yokhiye + +Comment=Configuration of keybindings +Comment[af]=Opstelling van sleutel bindinge +Comment[az]=Düymə bağlarının quraşdırılması +Comment[be]=Настаўленні клавішных скаротаў +Comment[bg]=Настройване на бързите клавиши +Comment[bn]=কী-বাইন্ডিং কনফিগারেশন +Comment[br]=Kefluniañ ereoù stokell +Comment[bs]=Podešavanje značenja tipki +Comment[ca]=Configuració dels lligams de tecles +Comment[cs]=Nastavení klávesových zkratek +Comment[csb]=Nastôw klawiszowëch skrodzënów +Comment[cy]=Furfweddiad o rwymiadau bysell +Comment[da]=Indstilling af tastebindinger +Comment[de]=Einrichtung von Tastenzuordnungen +Comment[el]=Ρύθμιση συνδυασμών πλήκτρων +Comment[eo]=Agordo de klavsignifoj, klavkombinoj +Comment[es]=Configuración de las asociaciones de las teclas +Comment[et]=Kiirklahvide seadistamine +Comment[eu]=Tekla elkarketen konfigurazioa +Comment[fa]=پیکربندی مقیدسازیهای کلید +Comment[fi]=Näppäinsidosten asetukset +Comment[fr]=Configuration des raccourcis clavier +Comment[fy]=Ynstellings foar fluchtoetsen +Comment[gl]=Configuración dos atallos de teclado +Comment[he]=שינוי הגדרות מיפוי המקשים +Comment[hi]=की-बाइंडिंग का कॉन्फ़िगरेशन +Comment[hr]=Konfiguriranje prečaca tipkovnice +Comment[hu]=A billentyűparancsok beállításai +Comment[id]=Konfigurasi keybindings +Comment[is]=Stillingar altækra flýtihnappa +Comment[it]=Configurazione delle associazioni di tasti +Comment[ja]=キーバインディングの設定 +Comment[ka]=კლავიშთა წყვილების კონფიგურაცია +Comment[kk]=Перне тіркесімдерді баптау +Comment[km]=កំណត់រចនាសម្ព័ន្ធការចងគ្រាប់ចុច +Comment[ko]=키 바인딩 설정 +Comment[lo]=ປັບແຕ່ງການຈັບຄູ່ປຸ່ມພິມ +Comment[lt]=Klavišų siečių derinimas +Comment[lv]=Taustiņsasaistes konfigurēšana +Comment[mk]=Конфигурација на врски меѓу копчиња и акции +Comment[mn]=Товчилуур холболтын тохируулга +Comment[ms]=Konfigurasi untuk pengikatan kekunci +Comment[mt]=Konfigurazzjoni ta' assoċjazzjonijiet tat-tasti +Comment[nb]=Oppsett av hurtigtaster +Comment[nds]=Instellen vun Tastkombinatschonen +Comment[ne]=कुञ्जी बाइन्डिङहरूको कन्फिगरेसन +Comment[nl]=Instellingen voor sneltoetsen +Comment[nn]=Oppsett av snøggtastar +Comment[nso]=Peakanyo ya ditlemaganyo tsa dinotlelo +Comment[oc]=Configuracion dèus lligams de tecles +Comment[pa]=ਕੀਬਾਇਡ ਦੀ ਸੰਰਚਨਾ +Comment[pl]=Ustawienia skrótów klawiszowych +Comment[pt]=Configuração das teclas +Comment[pt_BR]=Configuração dos atalhos de teclado +Comment[ro]=Configurează asocierile de taste +Comment[ru]=Настройка комбинаций клавиш +Comment[rw]=Iboneza ry'amahuza-buto +Comment[se]=Jođánisboaluid heiveheapmi +Comment[sk]=Konfigurácia globálnych klávesových skratiek +Comment[sl]=Nastavitve tipkovnih vezi +Comment[sr]=Подешавање пречица са тастатуре +Comment[sr@Latn]=Podešavanje prečica sa tastature +Comment[sv]=Anpassa kortkommandon +Comment[ta]=விசைசேர்வுகளுக்கான வடிவமைப்பு +Comment[tg]=Танзими аъмоли калидҳо +Comment[th]=ปรับแต่งปุ่มพิมพ์ลัด +Comment[tr]=Tuş bağıntılarının yapılandırılması +Comment[tt]=Töymä berläşmälären caylaw +Comment[uk]=Налаштування прив'язок клавіш +Comment[uz]=Tugmalar birikmasini moslash +Comment[uz@cyrillic]=Тугмалар бирикмасини мослаш +Comment[ven]=Nzudzanyo yau tanganyisa dzikhii +Comment[vi]=Cấu hình các tổ hợp phím +Comment[wa]=Apontiaedje des rascourtis di tapes +Comment[xh]=Uqwalaselo lwezibopheleo zesitshixo +Comment[zh_CN]=键绑定配置 +Comment[zh_TW]=按鍵關聯設定 +Comment[zu]=Inhlanganiselo yezibopho zokhiye + +Keywords=Keys,Global key bindings,Key scheme,Key bindings,shortcuts,application shortcuts +Keywords[af]=Keys,Global sleutel bindings,sleutel scheme,sleutel bindings,kortpaaie,application kortpaaie +Keywords[ar]=مفايتح، مفاتيح الاختصارات العامّة، خريطة المفاتيح، مفاتيح الاختصارات، اختصارات، اختصارات تطبيقات +Keywords[az]=düymələr,Qlobal Düymə bağlantıları,Düymə planı,düymə bağlamaları,qısa yollar,proqram qısa yolları +Keywords[be]=Клавішы,Глабальныя скароты,Схема клавішаў,Скароты,Скароты праграмы,Keys,Global key bindings,Key scheme,Key bindings,shortcuts,application shortcuts +Keywords[bg]=бърз, клавиш, бързи, достъп, клавишна, комбинация, Keys, Global key bindings, Key scheme, Key bindings, shortcuts, application shortcuts +Keywords[ca]=Tecles,lligams de tecles globals,Esquema de tecla,Lligams de tecles,dreceres,dreceres d'aplicació +Keywords[cs]=Klávesy,Globální klávesové zkratky,Schéma kláves,Klávesové zkratky,Zkratky,Aplikační zkratky,Vazby,Klávesové vazby +Keywords[csb]=Klawisze,globalné klawiszowé skrodzënë,schematë skrodzënów,sparłączenia klawiszów,skrodzënë dlô programów +Keywords[cy]=Bysell,Rhwymiadau bysell eang,Cynllun bysell,Llwybrau byr,Llwybrau byr y rhaglen +Keywords[da]=Taster,Globale tastebindinger,Tastesystem,Tastebindinger,genveje,programgenveje +Keywords[de]=Tasten,Tastenzuordnung,Tastenkürzel,Kurzbefehle,Tastenschema,Tastaturlayout +Keywords[el]=Πλήκτρα,Καθολικοί συνδυασμοί πλήκτρων,Θέμα πλήκτρων,Συνδυασμοί πλήκτρων,συντομεύσεις,συντομεύσεις εφαρμογών +Keywords[eo]=klavoj,malloka,signifoj,asocioj,kombinoj,klavkombinoj +Keywords[es]=Teclas,Asociaciones de teclas globales,Esquema de teclas,Asociaciones de teclas,accesos directos,accesos directos de aplicaciones +Keywords[et]=klahvid,globaalsed kiirklahvid,klahviskeem,kiirklahvid,klahvide seosed,rakenduste kiirklahvid +Keywords[eu]=Teklak,tekla elkarketa globalak,teklen eskema,tekla elkarketak lasterbideak,aplikazio lasterbideak +Keywords[fa]=کلیدها، مقیدسازیهای کلید سراسری، طرحوارۀ کلید، مقیدسازیهای کلید، میانبرها، میانبرهای کاربرد +Keywords[fi]=Näppäimet,Yleiset näppäinsidokset,Näppäinteema,Näppäinsidokset,pikavalinnat,sovellusten pikavalinnat +Keywords[fr]=touches,raccourcis globaux,modèle de raccourcis,raccourcis clavier,clavier,raccourcis d'applications,applications,raccourcis communs +Keywords[fy]=keys,toetsen,toetsyndielingen,toetsbiningen,key bindings,fluchtoetsen,globaal +Keywords[gl]=Teclas,Atallos de teclado globais,Esquema de teclas,Atallos de teclado,combinacións de teclas,atallos de aplicacións +Keywords[he]=מקשים,מיפוי מקשים גלובליים,תצורת מקשים,מיפוי מקשים,קיצורי דרך,קיצורי דרך של יישומים, Keys,Global key bindings,Key scheme,Key bindings,shortcuts,application shortcuts +Keywords[hi]=कुंजियाँ,ग्लोबल की-बाइंडिंग्स,कुंजी योजना,की-बाइंडिंग्स,शॉर्टकट्स,अनुप्रयोग शॉर्टकट्स +Keywords[hr]=Keys,Global key bindings,Key scheme,Key bindings,shortcuts,application shortcuts,Tipke,Prečaci tipkovnice,Raspored tipki,prečaci,prečaci aplikacija +Keywords[hu]=billentyűk,globális billentyűhozzárendelés,billentyűkiosztás,billentyűparancsok,gyorsbillentyűk +Keywords[id]=Keys,Key bindings Global,Key sheme,Key bindings,shortcuts,application shortcuts +Keywords[is]=Lyklar,Hnappar,Flýtihnappar,Flýtilyklar,Lyklabindingar +Keywords[it]=tasti,associazioni globali di tasti,schema di tasti,associazioni di tasti,scorciatoie,scorciatoie delle applicazioni +Keywords[ja]=キー,グローバルキー,キーバインド,Key sheme,キーバインド,ショートカット,アプリケーションショートカット +Keywords[km]=គ្រាប់ចុច,ការចងគ្រាប់ចុចសកល,គំនូរបំព្រួញគ្រាប់ចុច,ការចងគ្រាប់ចុច,ផ្លូវកាត់,ផ្លូវកាត់កម្មវិធី +Keywords[lo]=ປຸ່ມພິມ,ປຸ່ມພິມສ່ວນກາງູ,ຊຸດປຸ່ມພິມ,ການຈັບຄູ່ປຸ່ມພິມ,ປຸ່ມພິມລັດ,ແປ້ນພິມລັດ,ປຸ່ມພິມລັດອະພລິເຄຊັນ +Keywords[lt]=Keys,klavišai,Global key bindings,klavišų sietis,Key scheme,klavišų schema,klavišų išdėstymas,Key bindings,shortcuts,spartieji klavišai,application shortcuts,programų spartieji klavišai +Keywords[lv]=Taustiņi,Globālās taustiņu sasaistes,Taustiņu shēma,Taustiņu sasaistes,īsinājumikonas,aplikāciju īsinājumikonas +Keywords[mk]=Keys,Global key bindings,Key scheme,Key bindings,shortcuts,application shortcuts,Копчиња,Глобални врски на копчиња,Шема на копчиња,Врски на копчиња,кратенки,апликациони кратенки +Keywords[mn]=Товчилуур,Товчилуур холболт,Богино товчилуур, Богино тушаал,Товчилуурын схем,Гарын байрлал +Keywords[nb]=taster,generelle hurtigtaster,hurtigtaster,snarveier,programsnarveier +Keywords[nds]=Tasten,Globale Tastkombinatschonen,Tastschema,Tastkombinatschonen,Programmtasten +Keywords[ne]=कुञ्जी, विश्वब्यापी कुञ्जी बाइन्डिङ, कुञ्जी योजना, कुञ्जी बाइन्डिङ, सर्टकट, अनुप्रयोग सर्टकट +Keywords[nl]=keys,toetsen,toetsenindeling,toetsenbindingen,key bindings,sneltoetsen,globale toetsenbindingen +Keywords[nn]=tastar,globale snøggtastar,tasteoppsett,snøggtastar,snarvegar,programsnarvegar +Keywords[nso]=Dinotlelo,Ditlemo tsa dinotlelo tsa boditshabatshaba,Leano la dinotlelo, Ditselakopana,ditselakopana tsa tshomiso +Keywords[pl]=Klawisze,globalne skróty klawiszowe,schematy skrótów,powiązania klawiszów,skróty dla programów +Keywords[pt]=teclas,teclas globais,esquema de teclas,atribuições de teclas,atalhos,atalhos da aplicação +Keywords[pt_BR]=Teclas,Teclas de atalho globais,esquema de teclado,teclas de atalho,atalhos de aplicativos +Keywords[ro]=taste,asocieri globale de taste,schemă taste,asocieri taste,acceleratori,acceleratori aplicații,scurtături +Keywords[ru]=Keys,Global key bindings,Key scheme,Key bindings,shortcuts,application shortcuts,клавиши,комбинации клавиш +Keywords[rw]=Buto,Amahuza buto rusange,Igishushanyombonera cya buto,Amahuza buto,amahinanzira, amahinanzira ya porogaramu +Keywords[se]=boalut,oppalaš jođánisboalut,boalločoahkádusat,boalločatnasat,njuolgobálgát,prográmmanjuolgabálgát +Keywords[sk]=Klávesy,Globálne klávesové skratky,schéma kláves,klávesové skratky +Keywords[sl]=tipke,globalne vezi tipk,razporeditev tipk,vezi tipk,tipkovne vezi +Keywords[sr]=Keys,Global key bindings,Key scheme,Key bindings,shortcuts,application shortcuts,тастери,глобални тастери,пречица,шема тастера,пречице,програмске пречице +Keywords[sr@Latn]=Keys,Global key bindings,Key scheme,Key bindings,shortcuts,application shortcuts,tasteri,globalni tasteri,prečica,šema tastera,prečice,programske prečice +Keywords[sv]=Tangenter,Globala kortkommandon,bindningar,Tangentbindningar,genvägar,programgenvägar +Keywords[ta]=விசைகள்,உலகலாவிய விசை பிணைப்புகள்,விசை திட்டம்,விசை பிணைப்புகள்,குறுக்குவழிகள்,பயன்பாட்டுக் குறுக்குவழிகள் +Keywords[th]=ปุ่มพิมพ์,ปุ่มพิมพ์ส่วนกลาง,ชุดปุ่มพิมพ์,การจับคู่ปุ่มพิมพ์,ปุ่มพิมพ์ลัด,แป้นพิมพ์ลัด,ปุ่มพิมพ์ลัดแอพพลิเคชัน +Keywords[tr]=tuşlar,Küresel Tuş bağlantıları,Tuş planı,tuş bağlamaları,kısayollar,uygulama kısayolları +Keywords[uk]=клавіші,глобальні прив'язки клавіш,схема клавіш,прив'язка клавіш +Keywords[uz]=Tugmalar,Umumiy tugmalar birikmasi,Tugma qolipi,Tugmalar birikmasi,tugma va dastur birikmasi +Keywords[uz@cyrillic]=Тугмалар,Умумий тугмалар бирикмаси,Тугма қолипи,Тугмалар бирикмаси,тугма ва дастур бирикмаси +Keywords[ven]=Dzikhii,u badekanywa ha khii dzothe,tshikimu tsha khii,u badekanywa ha khii,tshikhau,tshikhau tsha apulifikhesheni +Keywords[vi]=Phím,tổ hợp phím toàn cục,phối hợp phím,gõ tắt với tổ hợp phím,gõ tắt cho ứng dụng +Keywords[wa]=tapes,globås rascourtis di tapes,adjinçmint del taprece,rascourtis di tapes,rascourtis,rascourtis d' programes +Keywords[xh]=Izitshixo,Izibophelelo zesitshixo esiNgqukuva,Udweliso lwesitshixo,Izibophelelo zesitshixo,iindlela ezimfutshane,izicelo zeendlela ezimfutshane +Keywords[zh_CN]=Keys,Global key bindings,Key scheme,Key bindings,shortcuts,application shortcuts,键,全局键绑定,键盘布局,键绑定,快捷键,程序快捷键 +Keywords[zh_TW]=Keys,Global key bindings,Key scheme,Key bindings,shortcuts,application shortcuts,按鍵,全域按建連結,鍵盤配置,按鍵連結,快速鍵,應用程式捷徑 +Keywords[zu]=Okhiye,Izibopho zokhiye zezizwe,Iplani lokhiye,Izibopho zokhiye,izindlela ezimfushane,izindlela ezimfushane zomyaleli + +Categories=Qt;KDE;X-KDE-settings-accessibility; diff --git a/kcontrol/keys/khotkeys.cpp b/kcontrol/keys/khotkeys.cpp new file mode 100644 index 000000000..869cab71a --- /dev/null +++ b/kcontrol/keys/khotkeys.cpp @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2000 Matthias Elter <elter@kde.org> + * Lubos Lunak <l.lunak@email.cz> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include <klibloader.h> +#include "khotkeys.h" + +extern "C" +{ + static void (*khotkeys_init_2)( void ); + static void (*khotkeys_cleanup_2)( void ); + static QString (*khotkeys_get_menu_entry_shortcut_2)( const QString& entry_P ); + static QString (*khotkeys_change_menu_entry_shortcut_2)( const QString& entry_P, + const QString& shortcut_P ); + static bool (*khotkeys_menu_entry_moved_2)( const QString& new_P, const QString& old_P ); + static void (*khotkeys_menu_entry_deleted_2)( const QString& entry_P ); +} + +static bool khotkeys_present = false; +static bool khotkeys_inited = false; + +bool KHotKeys::init() +{ + khotkeys_inited = true; + KLibrary* lib = KLibLoader::self()->library( "kcm_khotkeys.la" ); + if( lib == NULL ) return false; + + khotkeys_init_2 = ( void (*)(void)) ( lib->symbol( "khotkeys_init" )); + khotkeys_cleanup_2 = ( void (*)(void)) ( lib->symbol( "khotkeys_cleanup" )); + khotkeys_get_menu_entry_shortcut_2 = + ( QString (*)( const QString& )) + ( lib->symbol( "khotkeys_get_menu_entry_shortcut" )); + khotkeys_change_menu_entry_shortcut_2 = + ( QString (*)( const QString&, const QString& )) + ( lib->symbol( "khotkeys_change_menu_entry_shortcut" )); + khotkeys_menu_entry_moved_2 = + ( bool (*)( const QString&, const QString& )) + ( lib->symbol( "khotkeys_menu_entry_moved" )); + khotkeys_menu_entry_deleted_2 = + ( void (*)( const QString& )) + ( lib->symbol( "khotkeys_menu_entry_deleted" )); + if( khotkeys_init_2 + && khotkeys_cleanup_2 + && khotkeys_get_menu_entry_shortcut_2 + && khotkeys_change_menu_entry_shortcut_2 + && khotkeys_menu_entry_moved_2 + && khotkeys_menu_entry_deleted_2 ) + { + khotkeys_init_2(); + khotkeys_present = true; + return true; + } + return false; +} + +void KHotKeys::cleanup() +{ + if( khotkeys_inited ) + khotkeys_cleanup_2(); + khotkeys_inited = false; +} + +bool KHotKeys::present() +{ + if( !khotkeys_inited ) + init(); + return khotkeys_present; +} + +QString KHotKeys::getMenuEntryShortcut( const QString& entry_P ) +{ + if( !khotkeys_inited ) + init(); + if( !khotkeys_present ) + return ""; + return khotkeys_get_menu_entry_shortcut_2( entry_P ); +} + +QString KHotKeys::changeMenuEntryShortcut( const QString& entry_P, + const QString shortcut_P ) + { + if( !khotkeys_inited ) + init(); + if( !khotkeys_present ) + return ""; + return khotkeys_change_menu_entry_shortcut_2( entry_P, shortcut_P ); + } + +bool KHotKeys::menuEntryMoved( const QString& new_P, const QString& old_P ) +{ + if( !khotkeys_inited ) + init(); + if( !khotkeys_present ) + return ""; + return khotkeys_menu_entry_moved_2( new_P, old_P ); +} + +void KHotKeys::menuEntryDeleted( const QString& entry_P ) +{ + if( !khotkeys_inited ) + init(); + if( !khotkeys_present ) + return; + khotkeys_menu_entry_deleted_2( entry_P ); +} diff --git a/kcontrol/keys/khotkeys.h b/kcontrol/keys/khotkeys.h new file mode 100644 index 000000000..90ea17985 --- /dev/null +++ b/kcontrol/keys/khotkeys.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2000 Matthias Elter <elter@kde.org> + * Lubos Lunak <l.lunak@email.cz> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef __khotkeys_public_h__ +#define __khotkeys_public_h__ + +#include <qstring.h> + +// see kdebase/khotkeys/kcontrol for info on these + +class KHotKeys +{ +public: + static bool init(); + static void cleanup(); + static bool present(); + static QString getMenuEntryShortcut( const QString& entry_P ); + static QString changeMenuEntryShortcut( const QString& entry_P, + const QString shortcut_P ); + static bool menuEntryMoved( const QString& new_P, const QString& old_P ); + static void menuEntryDeleted( const QString& entry_P ); +}; + +#endif diff --git a/kcontrol/keys/mac4.kksrc b/kcontrol/keys/mac4.kksrc new file mode 100644 index 000000000..0968a2472 --- /dev/null +++ b/kcontrol/keys/mac4.kksrc @@ -0,0 +1,197 @@ +[Settings] +Name=Mac Scheme +Name[af]=Mac Tema +Name[be]=Схема Mac +Name[bg]=Mac +Name[bn]=ম্যাক্ স্কীম +Name[br]=Steuñv Mac +Name[bs]=Mac šema +Name[ca]=Esquema Mac +Name[cs]=Mac schéma +Name[csb]=Mòtiw Mac-a +Name[cy]=Cynllun Mac +Name[da]=Mac-system +Name[de]=Mac-Design +Name[el]=Μορφή Mac +Name[eo]=Makintoŝa aranĝo +Name[es]=Tema Mac +Name[et]=Maci skeem +Name[eu]=Mac eskema +Name[fa]=طرحوارۀ مکینتاش +Name[fi]=Mac-skeema +Name[fr]=Thème Mac +Name[fy]=Mac-skema +Name[ga]=Scéim Mac +Name[gl]=Esquema Mac +Name[he]=ערכת Mac +Name[hr]=Mac shema +Name[hu]=Mac +Name[id]=Skema Mac +Name[is]=Mac þema +Name[it]=Schema Mac +Name[ja]=Macintosh スキーマ +Name[ka]=Mac სქემა +Name[kk]=Mac сұлбасы +Name[km]=គំនូរបំព្រួញ Mac +Name[ko]=Mac 배열 +Name[lo]=ຊຸດຮູບແບບ Mac +Name[lt]=Mac schema +Name[mk]=Mac-шема +Name[mn]=Mac-Схем +Name[nb]=Mac-oppsett +Name[nds]=Mac-Vörbild +Name[ne]=म्याक योजना +Name[nl]=Mac-schema +Name[nn]=Mac-oppsett +Name[nso]=Leano la Mac +Name[pa]=Mac ਸਰੂਪ +Name[pl]=Motyw Mac-a +Name[pt]=Esquema do Mac +Name[pt_BR]=Esquema Mac +Name[ro]=Schemă Mac +Name[ru]=Mac +Name[rw]=Igishushanyombonera Mac +Name[se]=Mac-coakkáldat +Name[sk]=Mac schéma +Name[sl]=Shema Mac +Name[sr]=Mac-ова шема +Name[sr@Latn]=Mac-ova šema +Name[sv]=Mac schema +Name[th]=ใช้แบบของ MAC +Name[tr]=Mac Şeması +Name[tt]=Mac buyınça +Name[uk]=Схема Макінтошу +Name[uz]=Mac mavzusi +Name[uz@cyrillic]=Mac мавзуси +Name[ven]=Tshikimu tsha Mac +Name[vi]=Phối hợp của Mac +Name[wa]=Tinme Mac +Name[xh]=Udweliso lwe Mac +Name[zh_CN]=Mac 方案 +Name[zh_TW]=Mac 按鍵配置 +Name[zu]=Iplani le-Mac +Uses Win Modifier=true + +[Global Shortcuts] +Desktop Screenshot=Ctrl+Shift+3 +Enable/Disable Clipboard Actions=Alt+Ctrl+X +Run Command=Alt+F2 +Halt Computer=none +Halt without Confirmation=none +Kill Window=Alt+Ctrl+Escape +Lock Session=Alt+Ctrl+L +Logout=Alt+Ctrl+Delete +Logout without Confirmation=none +Manually Invoke Action on Current Clipboard=Alt+Ctrl+R +Mouse Emulation=none +Popup Launch Menu=Alt+F1 +Reboot Computer=none +Reboot without Confirmation=none +Show Klipper Popup-Menu=Alt+Ctrl+V +Show Taskmanager=Ctrl+Escape +Show Window List=Alt+F5 +Switch One Desktop Down=none +Switch One Desktop to the Left=none +Switch One Desktop to the Right=none +Switch One Desktop Up=none +Switch to Next Keyboard Layout=Alt+Ctrl+K +Switch to Desktop 1=Ctrl+F1 +Switch to Desktop 10=Ctrl+F10 +Switch to Desktop 11=Ctrl+F11 +Switch to Desktop 12=Ctrl+F12 +Switch to Desktop 13=Ctrl+Shift+F1 +Switch to Desktop 14=Ctrl+Shift+F2 +Switch to Desktop 15=Ctrl+Shift+F3 +Switch to Desktop 16=Ctrl+Shift+F4 +Switch to Desktop 2=Ctrl+F2 +Switch to Desktop 3=Ctrl+F3 +Switch to Desktop 4=Ctrl+F4 +Switch to Desktop 5=Ctrl+F5 +Switch to Desktop 6=Ctrl+F6 +Switch to Desktop 7=Ctrl+F7 +Switch to Desktop 8=Ctrl+F8 +Switch to Desktop 9=Ctrl+F9 +Switch to Next Desktop=none +Switch to Previous Desktop=none +Toggle Showing Desktop=Alt+Ctrl+D +Toggle Window Raise/Lower=Ctrl+E +Walk Through Desktop List=none +Walk Through Desktop List (Reverse)=none +Walk Through Desktops=Alt+Tab +Walk Through Desktops (Reverse)=Alt+Shift+Tab +Walk Through Windows=Ctrl+Tab +Walk Through Windows (Reverse)=Ctrl+Shift+Tab +Window Close=Alt+F4 +Window Iconify=none +Window Lower=none +Window Maximize=none +Window Maximize Horizontal=none +Window Maximize Vertical=none +Window Move=none +Window Operations Menu=Alt+F3 +Window Raise=none +Window Resize=none +Window Screenshot=Ctrl+Shift+4 +Window Shade=none +Window to Desktop 1=none +Window to Desktop 10=none +Window to Desktop 11=none +Window to Desktop 12=none +Window to Desktop 13=none +Window to Desktop 14=none +Window to Desktop 15=none +Window to Desktop 16=none +Window to Desktop 2=none +Window to Desktop 3=none +Window to Desktop 4=none +Window to Desktop 5=none +Window to Desktop 6=none +Window to Desktop 7=none +Window to Desktop 8=none +Window to Desktop 9=none +Window to Next Desktop=none +Window to Previous Desktop=none + +[Shortcuts] +AddBookmark=Ctrl+B +Back=Alt+Left +Close=Ctrl+W +Copy=Ctrl+C +Cut=Ctrl+X +DeleteWordBack=Ctrl+Backspace +DeleteWordForward=Ctrl+Delete +Deselect=Ctrl+Shift+A +End=Ctrl+End +Find=Ctrl+F +FindNext=Ctrl+G +FindPrev=Ctrl+Shift+G +Forward=Alt+Right +GotoLine=none +Help=F1 +Home=Ctrl+Home +Insert=Ctrl+Insert +New=Ctrl+N +Next=Next +NextCompletion=Ctrl+Down +Open=Ctrl+O +Paste=Ctrl+V +PopupMenuContext=Menu +PrevCompletion=Ctrl+Up +Print=Ctrl+P +Prior=Prior +Quit=Ctrl+Q +Redo=Ctrl+Shift+Z +Reload=F5 +Replace=Ctrl+R +RotateDown=Down +RotateUp=Up +Save=Ctrl+S +SelectAll=Ctrl+A +ShowMenubar=Ctrl+M +SubstringCompletion=Ctrl+T +TextCompletion=Ctrl+E +Undo=Ctrl+Z +Up=Alt+Up +WhatsThis=Shift+F1 +ZoomIn=Ctrl+Plus +ZoomOut=Ctrl+Minus diff --git a/kcontrol/keys/main.cpp b/kcontrol/keys/main.cpp new file mode 100644 index 000000000..c03c26f91 --- /dev/null +++ b/kcontrol/keys/main.cpp @@ -0,0 +1,203 @@ +/* + * main.cpp + * + * Copyright (c) 1999 Matthias Hoelzer-Kluepfel <hoelzer@kde.org> + * + * Requires the Qt widget libraries, available at no cost at + * http://www.troll.no/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include <qlayout.h> + +#include <kdebug.h> +#include <klocale.h> +#include <ksimpleconfig.h> + +#include "commandShortcuts.h" +#include "main.h" +#include "modifiers.h" +#include "shortcuts.h" +#include "khotkeys.h" + +/* +| Shortcut Schemes | Modifier Keys | + +o Current scheme o New scheme o Pre-set scheme +| KDE Traditional |v|| <Save Scheme...> <Remove Scheme> +[] Prefer 4-modifier defaults + +o Current scheme +o New scheme <Save Scheme> +o Pre-set scheme <Remove Scheme> + | KDE Traditional |v|| +[] Prefer 4-modifier defaults + +Global Shortcuts +*/ +KeyModule::KeyModule( QWidget *parent, const char *name ) +: KCModule( parent, name ) +{ + setQuickHelp( i18n("<h1>Keyboard Shortcuts</h1> Using shortcuts you can configure certain actions to be" + " triggered when you press a key or a combination of keys, e.g. Ctrl+C is normally bound to" + " 'Copy'. KDE allows you to store more than one 'scheme' of shortcuts, so you might want" + " to experiment a little setting up your own scheme, although you can still change back to the" + " KDE defaults.<p> In the 'Global Shortcuts' tab you can configure non-application-specific" + " bindings, like how to switch desktops or maximize a window; in the 'Application Shortcuts' tab" + " you will find bindings typically used in applications, such as copy and paste.")); + + initGUI(); +} + +KeyModule::~KeyModule() +{ + KHotKeys::cleanup(); +} + +void KeyModule::initGUI() +{ + m_pTab = new QTabWidget( this ); + QVBoxLayout *l = new QVBoxLayout(this); + l->addWidget(m_pTab); + + m_pShortcuts = new ShortcutsModule( this ); + m_pTab->addTab( m_pShortcuts, i18n("Shortcut Schemes") ); + connect( m_pShortcuts, SIGNAL(changed(bool)), SIGNAL(changed(bool)) ); + + m_pCommandShortcuts = new CommandShortcutsModule ( this ); + m_pTab->addTab( m_pCommandShortcuts, i18n("Command Shortcuts") ); + connect( m_pCommandShortcuts, SIGNAL(changed(bool)), SIGNAL(changed(bool)) ); + connect( m_pTab, SIGNAL(currentChanged(QWidget*)), m_pCommandShortcuts, SLOT(showing(QWidget*)) ); + + m_pModifiers = new ModifiersModule( this ); + m_pTab->addTab( m_pModifiers, i18n("Modifier Keys") ); + connect( m_pModifiers, SIGNAL(changed(bool)), SIGNAL(changed(bool)) ); +} + +void KeyModule::load() +{ + load( false ); +} + +// Called when [Reset] is pressed +void KeyModule::load( bool useDefaults ) +{ + kdDebug(125) << "KeyModule::load()" << endl; + m_pShortcuts->load(); + m_pCommandShortcuts->load(); + m_pModifiers->load( useDefaults ); + + emit changed( useDefaults ); +} + +// When [Apply] or [OK] are clicked. +void KeyModule::save() +{ + kdDebug(125) << "KeyModule::save()" << endl; + m_pShortcuts->save(); + m_pCommandShortcuts->save(); + m_pModifiers->save(); +} + +void KeyModule::defaults() +{ + kdDebug(125) << "KeyModule::defaults()" << endl; + m_pShortcuts->defaults(); + m_pCommandShortcuts->defaults(); + m_pModifiers->defaults(); +} + +void KeyModule::resizeEvent( QResizeEvent * ) +{ + m_pTab->setGeometry( 0, 0, width(), height() ); +} + +//---------------------------------------------------- + +extern "C" +{ + KDE_EXPORT KCModule *create_keys(QWidget *parent, const char * /*name*/) + { + // What does this do? Why not insert klipper and kxkb, too? --ellis, 2002/01/15 + KGlobal::locale()->insertCatalogue("kwin"); + KGlobal::locale()->insertCatalogue("kdesktop"); + KGlobal::locale()->insertCatalogue("kicker"); + return new KeyModule(parent, "kcmkeys"); + } + + KDE_EXPORT void initModifiers() + { + kdDebug(125) << "KeyModule::initModifiers()" << endl; + + KConfigGroupSaver cgs( KGlobal::config(), "Keyboard" ); + bool bMacSwap = KGlobal::config()->readBoolEntry( "Mac Modifier Swap", false ); + if( bMacSwap ) + ModifiersModule::setupMacModifierKeys(); + } + + KDE_EXPORT void init_keys() + { + kdDebug(125) << "KeyModule::init()\n"; + + /*kdDebug(125) << "KKeyModule::init() - Initialize # Modifier Keys Settings\n"; + KConfigGroupSaver cgs( KGlobal::config(), "Keyboard" ); + QString fourMods = KGlobal::config()->readEntry( "Use Four Modifier Keys", KAccel::keyboardHasMetaKey() ? "true" : "false" ); + KAccel::useFourModifierKeys( fourMods == "true" ); + bool bUseFourModifierKeys = KAccel::useFourModifierKeys(); + KGlobal::config()->writeEntry( "User Four Modifier Keys", bUseFourModifierKeys ? "true" : "false", true, true ); + */ + KAccelActions* keys = new KAccelActions(); + + kdDebug(125) << "KeyModule::init() - Load Included Bindings\n"; +// this should match the included files above +#define NOSLOTS +#define SHIFT Qt::SHIFT +#define CTRL Qt::CTRL +#define ALT Qt::ALT +#include "../../klipper/klipperbindings.cpp" +#include "../../kwin/kwinbindings.cpp" +#define KICKER_ALL_BINDINGS +#include "../../kicker/kicker/core/kickerbindings.cpp" +#include "../../kicker/taskbar/taskbarbindings.cpp" +#include "../../kdesktop/kdesktopbindings.cpp" +#include "../../kxkb/kxkbbindings.cpp" + + // Write all the global keys to kdeglobals. + // This is needed to be able to check for conflicts with global keys in app's keyconfig + // dialogs, kdeglobals is empty as long as you don't apply any change in controlcenter/keys. + // However, avoid writing at every KDE startup, just update them after every rebuild of this file. + KConfigGroup group( KGlobal::config(), "Global Shortcuts" ); + if( group.readEntry( "Defaults timestamp" ) != __DATE__ __TIME__ ) { + kdDebug(125) << "KeyModule::init() - Read Config Bindings\n"; + // Check for old group, + if( KGlobal::config()->hasGroup( "Global Keys" ) ) { + keys->readActions( "Global Keys" ); + KGlobal::config()->deleteGroup( "Global Keys", true, true ); + } + keys->readActions( "Global Shortcuts" ); + KGlobal::config()->deleteGroup( "Global Shortcuts", true, true ); + + kdDebug(125) << "KeyModule::init() - Write Config Bindings\n"; + keys->writeActions( "Global Shortcuts", 0, true, true ); + group.writeEntry( "Defaults timestamp", __DATE__ __TIME__, true, true ); + } + delete keys; + + initModifiers(); + } +} + +#include "main.moc" diff --git a/kcontrol/keys/main.h b/kcontrol/keys/main.h new file mode 100644 index 000000000..5cabba122 --- /dev/null +++ b/kcontrol/keys/main.h @@ -0,0 +1,57 @@ +/* + * main.h + * + * Copyright (c) 1999 Matthias Hoelzer-Kluepfel <hoelzer@kde.org> + * + * Requires the Qt widget libraries, available at no cost at + * http://www.troll.no/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef __keys_main_h +#define __keys_main_h + +#include <qtabwidget.h> +#include <kcmodule.h> + +class CommandShortcutsModule; +class ShortcutsModule; +class ModifiersModule; + +class KeyModule : public KCModule +{ + Q_OBJECT + public: + KeyModule( QWidget *parent, const char *name ); + ~KeyModule(); + + void load(); + void load( bool useDefaults ); + void save(); + void defaults(); + + protected: + void initGUI(); + void resizeEvent( QResizeEvent* ); + + private: + QTabWidget* m_pTab; + CommandShortcutsModule* m_pCommandShortcuts; + ShortcutsModule* m_pShortcuts; + ModifiersModule* m_pModifiers; +}; + +#endif diff --git a/kcontrol/keys/modifiers.cpp b/kcontrol/keys/modifiers.cpp new file mode 100644 index 000000000..8391c7938 --- /dev/null +++ b/kcontrol/keys/modifiers.cpp @@ -0,0 +1,354 @@ +#include "modifiers.h" + +#include <qcheckbox.h> +#include <qgroupbox.h> +#include <qlabel.h> +#include <qlayout.h> +#include <qwhatsthis.h> + +#include <kapplication.h> +#include <kconfig.h> +#include <kdebug.h> +#include <kdialog.h> +#include <kkeynative.h> +#include <klistview.h> +#include <klocale.h> +#include <kmessagebox.h> + +#define XK_MISCELLANY +#define XK_XKB_KEYS +#include <X11/X.h> +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/keysymdef.h> +#include <ctype.h> +#undef NONE + +/*Modifier Scheme + PC: Shift/Ctrl/Alt/Win + Mac: Shift/Command/Apple/Alt + Custom + +X11 +Modifier XMod Label +Shift Shift [Shift] +Ctrl Control [Ctrl] Ctrl|Apple +Alt [Mod1] [Alt] Alt|Command +Win [Mod4] [Win] Win|Alt|Meta|Super|Hyper +Extra1 [] [] User definable + + Shift + Lock Caps_Lock + Control Control_L, Control_R + Mod1 Alt_L, Alt_R + Mod2 Num_Lock + Mod3 Mode_switch + Mod4 Super_L, Super_R + Mod5 Scroll_Lock +*/ + +//For Mac keyboards: +//1) labels: Shift | Ctrl | Option | Command +//2) swap Ctrl & Command + +ModifiersModule::ModifiersModule( QWidget *parent, const char *name ) +: QWidget( parent, name ) +{ + initGUI(); + load( false ); +} + +void ModifiersModule::load( bool useDefaults ) +{ + KConfig *c = KGlobal::config(); + + c->setReadDefaults( useDefaults ); + + c->setGroup( "Keyboard" ); + + m_sLabelCtrlOrig = c->readEntry( "Label Ctrl", "Ctrl" ); + m_sLabelAltOrig = c->readEntry( "Label Alt", "Alt" ); + m_sLabelWinOrig = c->readEntry( "Label Win", "Win" ); + + m_bMacKeyboardOrig = c->readBoolEntry( "Mac Keyboard", false ); + m_bMacSwapOrig = m_bMacKeyboardOrig && c->readBoolEntry( "Mac Modifier Swap", false ); + + updateWidgetData(); +} + +// When [Apply] or [OK] are clicked. +void ModifiersModule::save() +{ + kdDebug(125) << "ModifiersModule::save()" << endl; + + KConfigGroupSaver cgs( KGlobal::config(), "Keyboard" ); + + if( m_plblCtrl->text() != "Ctrl" ) + KGlobal::config()->writeEntry( "Label Ctrl", m_plblCtrl->text(), true, true ); + else + KGlobal::config()->deleteEntry( "Label Ctrl", false, true ); + + if( m_plblAlt->text() != "Alt" ) + KGlobal::config()->writeEntry( "Label Alt", m_plblAlt->text(), true, true ); + else + KGlobal::config()->deleteEntry( "Label Alt", false, true ); + + if( m_plblWin->text() != "Win" ) + KGlobal::config()->writeEntry( "Label Win", m_plblWin->text(), true, true ); + else + KGlobal::config()->deleteEntry( "Label Win", false, true ); + + if( m_pchkMacKeyboard->isChecked() ) + KGlobal::config()->writeEntry( "Mac Keyboard", true, true, true ); + else + KGlobal::config()->deleteEntry( "Mac Keyboard", false, true ); + + bool bMacSwap = m_pchkMacKeyboard->isChecked() && m_pchkMacSwap->isChecked(); + if( bMacSwap ) + KGlobal::config()->writeEntry( "Mac Modifier Swap", true, true, true ); + else + KGlobal::config()->deleteEntry( "Mac Modifier Swap", false, true ); + + KGlobal::config()->sync(); + + if( m_bMacSwapOrig != bMacSwap ) { + if( bMacSwap ) + setupMacModifierKeys(); + else + kapp->kdeinitExec("kxkb"); + m_bMacSwapOrig = bMacSwap; + updateWidgets(); + } +} + +void ModifiersModule::defaults() +{ + load( true ); +} + +#define SET_CODE_SYM( iCode, sym ) \ + if( iCode >= keyCodeMin && iCode <= keyCodeMax ) \ + rgKeySyms[(iCode-keyCodeMin) * nSymsPerCode] = sym; +#define SET_MOD_CODE( iMod, code1, code2 ) \ + xmk->modifiermap[iMod * xmk->max_keypermod + 0] = code1; \ + xmk->modifiermap[iMod * xmk->max_keypermod + 1] = code2; +void ModifiersModule::setupMacModifierKeys() +{ + const int CODE_Ctrl_L = 0x25, CODE_Ctrl_R = 0x6d; + const int CODE_Win_L = 0x73, CODE_Win_R = 0x74; + //const int CODE_Alt_L = 0x40, CODE_Alt_R = 0x71; + int keyCodeMin, keyCodeMax, nKeyCodes, nSymsPerCode; + + XDisplayKeycodes( qt_xdisplay(), &keyCodeMin, &keyCodeMax ); + nKeyCodes = keyCodeMax - keyCodeMin + 1; + KeySym* rgKeySyms = XGetKeyboardMapping( qt_xdisplay(), keyCodeMin, nKeyCodes, &nSymsPerCode ); + XModifierKeymap* xmk = XGetModifierMapping( qt_xdisplay() ); + + SET_CODE_SYM( CODE_Ctrl_L, XK_Super_L ) + SET_CODE_SYM( CODE_Ctrl_R, XK_Super_R ) + SET_CODE_SYM( CODE_Win_L, XK_Control_L ) + SET_CODE_SYM( CODE_Win_R, XK_Control_R ) + //SET_CODE_SYM( CODE_Win_L, XK_Alt_L ) + //SET_CODE_SYM( CODE_Win_R, XK_Alt_R ) + //SET_CODE_SYM( CODE_Alt_L, XK_Control_L ) + //SET_CODE_SYM( CODE_Alt_R, XK_Control_R ) + + SET_MOD_CODE( ControlMapIndex, CODE_Win_L, CODE_Win_R ); + SET_MOD_CODE( Mod4MapIndex, CODE_Ctrl_L, CODE_Ctrl_R ); + //SET_MOD_CODE( ControlMapIndex, CODE_Alt_L, CODE_Alt_R ); + //SET_MOD_CODE( Mod1MapIndex, CODE_Win_L, CODE_Win_R ); + //SET_MOD_CODE( Mod4MapIndex, CODE_Ctrl_L, CODE_Ctrl_R ); + + XSetModifierMapping( qt_xdisplay(), xmk ); + XChangeKeyboardMapping( qt_xdisplay(), keyCodeMin, nSymsPerCode, rgKeySyms, nKeyCodes ); + XFree( rgKeySyms ); + XFreeModifiermap( xmk ); +} +#undef SET_CODE_SYM + +void ModifiersModule::initGUI() +{ + QGridLayout* pLayoutTop = new QGridLayout( this, 6, 2, KDialog::marginHint() ); + pLayoutTop->setColStretch( 1, 1 ); + + QGroupBox* pGroup = new QGroupBox( 2, Qt::Horizontal, i18n("KDE Modifiers"), this ); + pLayoutTop->addWidget( pGroup, 0, 0 ); + + QLabel* plbl = new QLabel( i18n("Modifier"), pGroup ); + QFont font = plbl->font(); + font.setUnderline( true ); + font.setWeight( QFont::Bold ); + plbl->setFont( font ); + plbl = new QLabel( i18n("X11-Mod"), pGroup ); + plbl->setFont( font ); + + new QLabel( i18n("QAccel", "Shift"), pGroup ); + new QLabel( "shift", pGroup ); + + m_plblCtrl = new QLabel( i18n("QAccel", "Ctrl"), pGroup ); + new QLabel( "control", pGroup ); + + m_plblAlt = new QLabel( i18n("QAccel", "Alt"), pGroup ); + new QLabel( "mod1", pGroup ); + + m_plblWin = new QLabel( i18n("Win"), pGroup ); + m_plblWinModX = new QLabel( "", pGroup ); + /*m_pcbWinX = newModXComboBox( pGroup ); + int i; + switch( KKeyNative::modX(KKey::WIN) ) { + case Mod2Mask: i = 1; break; + case Mod3Mask: i = 2; break; + case Mod4Mask: i = 3; break; + case Mod5Mask: i = 5; break; + default: i = 0; + } + m_pcbWinX->setCurrentItem( i );*/ + + m_pchkMacKeyboard = new QCheckBox( i18n("Macintosh keyboard"), this ); + m_pchkMacKeyboard->setChecked( m_bMacKeyboardOrig ); + connect( m_pchkMacKeyboard, SIGNAL(clicked()), SLOT(slotMacKeyboardClicked()) ); + pLayoutTop->addWidget( m_pchkMacKeyboard, 1, 0 ); + + m_pchkMacSwap = new QCheckBox( i18n("MacOS-style modifier usage"), this ); + m_pchkMacSwap->setChecked( m_bMacSwapOrig ); + QWhatsThis::add( m_pchkMacSwap, + i18n("Checking this box will change your X Modifier Mapping to " + "better reflect the standard MacOS modifier key usage. " + "It allows you to use <i>Command+C</i> for <i>Copy</i>, for instance, " + "instead of the PC standard of <i>Ctrl+C</I>. " + "<b>Command</b> will be used for application and console commands, " + "<b>Option</b> as a command modifier and for navigating menus and dialogs, " + "and <b>Control</b> for window manager commands.") ); + connect( m_pchkMacSwap, SIGNAL(clicked()), SLOT(slotMacSwapClicked()) ); + pLayoutTop->addWidget( m_pchkMacSwap, 2, 0 ); + + //------------------ + pLayoutTop->addRowSpacing( 3, KDialog::spacingHint() * 3 ); + + pGroup = new QGroupBox( 1, Qt::Horizontal, i18n("X Modifier Mapping"), this ); + pLayoutTop->addWidget( pGroup, 4, 0 ); + + m_plstXMods = new KListView( pGroup ); + m_plstXMods->setSorting( -1 ); + m_plstXMods->setSelectionMode( QListView::NoSelection ); + m_plstXMods->setAllColumnsShowFocus( true ); + m_plstXMods->addColumn( i18n("X11-Mod") ); + + new KListViewItem( m_plstXMods, "mod5" ); + new KListViewItem( m_plstXMods, "mod4" ); + new KListViewItem( m_plstXMods, "mod3" ); + new KListViewItem( m_plstXMods, "mod2" ); + new KListViewItem( m_plstXMods, "mod1" ); + new KListViewItem( m_plstXMods, "control" ); + new KListViewItem( m_plstXMods, "lock" ); + new KListViewItem( m_plstXMods, "shift" ); + + //------------------ + pLayoutTop->setRowStretch( 5, 1 ); + + updateWidgets(); +} + +/*KComboBox* ModifiersModule::newModXComboBox( QWidget* parent ) +{ + KComboBox* pcb = new KComboBox( parent ); + pcb->insertItem( "" ); + pcb->insertItem( "mod2" ); + pcb->insertItem( "mod3" ); + pcb->insertItem( "mod4" ); + pcb->insertItem( "mod5" ); + return pcb; +}*/ + +void ModifiersModule::updateWidgetData() +{ + m_plblCtrl->setText( m_sLabelCtrlOrig ); + m_plblAlt->setText( m_sLabelAltOrig ); + m_plblWin->setText( m_sLabelWinOrig ); + m_pchkMacKeyboard->setChecked( m_bMacKeyboardOrig ); + m_pchkMacSwap->setChecked( m_bMacSwapOrig ); + m_pchkMacSwap->setEnabled( m_bMacKeyboardOrig ); +} + +void ModifiersModule::updateWidgets() +{ + if( m_pchkMacKeyboard->isChecked() ) { + // If keys are swapped around to reflect MacOS norms: + if( m_pchkMacSwap->isChecked() ) { + m_plblCtrl->setText( i18n("Command") ); // Ctrl in Alt's place + m_plblAlt->setText( i18n("Option") ); // Alt in Win's place + m_plblWin->setText( i18n("Control") ); // Win in Ctrl's place + } else { + m_plblCtrl->setText( i18n("Control") ); // Ctrl labeled Control + m_plblAlt->setText( i18n("Option") ); // Alt labeled Command + m_plblWin->setText( i18n("Command") ); // Win labeled Option + } + m_pchkMacSwap->setEnabled( true ); + } else { + m_plblCtrl->setText( i18n("QAccel", "Ctrl") ); + m_plblAlt->setText( i18n("QAccel", "Alt") ); + m_plblWin->setText( i18n("Win") ); + m_pchkMacSwap->setEnabled( false ); + } + + XModifierKeymap* xmk = XGetModifierMapping( qt_xdisplay() ); + + for( int iKey = m_plstXMods->columns()-1; iKey < xmk->max_keypermod; iKey++ ) + m_plstXMods->addColumn( i18n("Key %1").arg(iKey+1) ); + + //int iModWinDef = -1; + for( int iMod = 0; iMod < 8; iMod++ ) { + // Find the default modifier index for the Win key. + /*if( iMod > Mod2Index ) { + uint symX = XKeycodeToKeysym( qt_xdisplay(), xmk->modifiermap[xmk->max_keypermod * iMod], 0 ); + if( symX == XK_Super_L || symX == XK_Super_R ) + iModWinDef = iMod; + else if( iModWinDef == -1 && (symX == XK_Meta_L || symX == XK_Meta_R) ) + iModWinDef = iMod; + }*/ + + // Insert items into X modifier map list + for( int iKey = 0; iKey < xmk->max_keypermod; iKey++ ) { + uint symX = XKeycodeToKeysym( qt_xdisplay(), xmk->modifiermap[xmk->max_keypermod * iMod + iKey], 0 ); + m_plstXMods->itemAtIndex( iMod )->setText( 1 + iKey, XKeysymToString( symX ) ); + } + } + + XFreeModifiermap( xmk ); + + int i; + switch( KKeyNative::modX(KKey::WIN) ) { + case Mod2Mask: i = 2; break; + case Mod3Mask: i = 3; break; + case Mod4Mask: i = 4; break; + case Mod5Mask: i = 5; break; + default: i = 0; + } + if( i != 0 ) + m_plblWinModX->setText( "mod" + QString::number(i) ); + else + m_plblWinModX->setText( "<" + i18n("None") + ">" ); +} + +void ModifiersModule::slotMacKeyboardClicked() +{ + updateWidgets(); + emit changed( true ); +} + +void ModifiersModule::slotMacSwapClicked() +{ + if( m_pchkMacKeyboard->isChecked() && !KKeyNative::keyboardHasWinKey() ) { + KMessageBox::sorry( this, + i18n("You can only activate this option if your " + "X keyboard layout has the 'Super' or 'Meta' keys " + "properly configured as modifier keys."), + "Incompatibility" ); + m_pchkMacSwap->setChecked( false ); + } else { + updateWidgets(); + emit changed( true ); + } +} + +#include "modifiers.moc" diff --git a/kcontrol/keys/modifiers.h b/kcontrol/keys/modifiers.h new file mode 100644 index 000000000..60ce76ae9 --- /dev/null +++ b/kcontrol/keys/modifiers.h @@ -0,0 +1,49 @@ +#ifndef __MODIFIERS_MODULE_H +#define __MODIFIERS_MODULE_H + +#include <qwidget.h> + +class QCheckBox; +class QLabel; +class KComboBox; +class KListView; + +class ModifiersModule : public QWidget +{ + Q_OBJECT + public: + ModifiersModule( QWidget *parent = 0, const char *name = 0 ); + + void load( bool useDefaults ); + void save(); + void defaults(); + + static void setupMacModifierKeys(); + + signals: + void changed( bool ); + + protected: + bool m_bMacKeyboardOrig, m_bMacSwapOrig; + QString m_sLabelCtrlOrig, m_sLabelAltOrig, m_sLabelWinOrig; + + QLabel* m_plblCtrl, * m_plblAlt, * m_plblWin; + QLabel* m_plblWinModX; + QCheckBox* m_pchkMacKeyboard; + KListView* m_plstXMods; + QCheckBox* m_pchkMacSwap; + + void initGUI(); + // Places the values in the *Orig variables into their + // respective widgets. + void updateWidgetData(); + // Updates the labels according to the check-box settings + // and also reads in the X modifier map. + void updateWidgets(); + + protected slots: + void slotMacKeyboardClicked(); + void slotMacSwapClicked(); +}; + +#endif diff --git a/kcontrol/keys/shortcuts.cpp b/kcontrol/keys/shortcuts.cpp new file mode 100644 index 000000000..e65364f4c --- /dev/null +++ b/kcontrol/keys/shortcuts.cpp @@ -0,0 +1,435 @@ +/* + * shortcuts.cpp + * + * Copyright (c) 1999 Matthias Hoelzer-Kluepfel <hoelzer@kde.org> + * Copyright (c) 2001 Ellis Whitehead <ellis@kde.org> + * + * Requires the Qt widget libraries, available at no cost at + * http://www.troll.no/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#include "shortcuts.h" + +#include <qdir.h> +#include <qlayout.h> +#include <qwhatsthis.h> + +#include <kapplication.h> +#include <kdebug.h> +#include <kipc.h> +#include <kkeynative.h> +#include <kinputdialog.h> +#include <klocale.h> +#include <kmessagebox.h> +#include <kshortcutlist.h> +#include <ksimpleconfig.h> +#include <kstandarddirs.h> + +ShortcutsModule::ShortcutsModule( QWidget *parent, const char *name ) +: QWidget( parent, name ) +{ + initGUI(); +} + +ShortcutsModule::~ShortcutsModule() +{ + delete m_pListGeneral; + delete m_pListSequence; + delete m_pListApplication; +} + +// Called when [Reset] is pressed +void ShortcutsModule::load() +{ + kdDebug(125) << "ShortcutsModule::load()" << endl; + slotSchemeCur(); +} + +// When [Apply] or [OK] are clicked. +void ShortcutsModule::save() +{ + kdDebug(125) << "ShortcutsModule::save()" << endl; + + // FIXME: This isn't working. Why? -- ellis, 2002/01/27 + // Check for old group, + if( KGlobal::config()->hasGroup( "Keys" ) ) { + KGlobal::config()->deleteGroup( "Keys", true, true ); + } + KGlobal::config()->sync(); + + m_pkcGeneral->commitChanges(); + m_pkcSequence->commitChanges(); + m_pkcApplication->save(); + + m_actionsGeneral.writeActions( "Global Shortcuts", 0, true, true ); + m_actionsSequence.writeActions( "Global Shortcuts", 0, true, true ); + + KIPC::sendMessageAll( KIPC::SettingsChanged, KApplication::SETTINGS_SHORTCUTS ); +} + +void ShortcutsModule::defaults() +{ + m_pkcGeneral->allDefault(); + m_pkcSequence->allDefault(); + m_pkcApplication->allDefault(); +} + +QString ShortcutsModule::quickHelp() const +{ + return i18n("<h1>Key Bindings</h1> Using key bindings you can configure certain actions to be" + " triggered when you press a key or a combination of keys, e.g. Ctrl+C is normally bound to" + " 'Copy'. KDE allows you to store more than one 'scheme' of key bindings, so you might want" + " to experiment a little setting up your own scheme while you can still change back to the" + " KDE defaults.<p> In the tab 'Global Shortcuts' you can configure non-application specific" + " bindings like how to switch desktops or maximize a window. In the tab 'Application Shortcuts'" + " you will find bindings typically used in applications, such as copy and paste."); +} + +void ShortcutsModule::initGUI() +{ + kdDebug(125) << "A-----------" << endl; + KAccelActions* keys = &m_actionsGeneral; +// see also KShortcutsModule::init() below !!! +#define NOSLOTS +#define KICKER_ALL_BINDINGS +#include "../../kwin/kwinbindings.cpp" +#include "../../kicker/kicker/core/kickerbindings.cpp" +#include "../../kicker/taskbar/taskbarbindings.cpp" +#include "../../kdesktop/kdesktopbindings.cpp" +#include "../../klipper/klipperbindings.cpp" +#include "../../kxkb/kxkbbindings.cpp" + + kdDebug(125) << "B-----------" << endl; + m_actionsSequence.init( m_actionsGeneral ); + + kdDebug(125) << "C-----------" << endl; + createActionsGeneral(); + kdDebug(125) << "D-----------" << endl; + createActionsSequence(); + kdDebug(125) << "E-----------" << endl; + + kdDebug(125) << "F-----------" << endl; + QVBoxLayout* pVLayout = new QVBoxLayout( this, KDialog::marginHint() ); + + pVLayout->addSpacing( KDialog::marginHint() ); + + // (o) [Current ] <Remove> ( ) New <Save> + + QHBoxLayout *pHLayout = new QHBoxLayout( pVLayout, KDialog::spacingHint() ); + QButtonGroup* pGroup = new QButtonGroup( this ); + pGroup->hide(); + + m_prbPre = new QRadioButton( "", this ); + connect( m_prbPre, SIGNAL(clicked()), SLOT(slotSchemeCur()) ); + pGroup->insert( m_prbPre ); + pHLayout->addWidget( m_prbPre ); + + m_pcbSchemes = new KComboBox( this ); + m_pcbSchemes->setMinimumWidth( 100 ); + m_pcbSchemes->setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Fixed ); + connect( m_pcbSchemes, SIGNAL(activated(int)), SLOT(slotSelectScheme(int)) ); + pHLayout->addWidget( m_pcbSchemes ); + + pHLayout->addSpacing( KDialog::marginHint() ); + + m_pbtnRemove = new QPushButton( i18n("&Remove"), this ); + m_pbtnRemove->setEnabled( false ); + connect( m_pbtnRemove, SIGNAL(clicked()), SLOT(slotRemoveScheme()) ); + QWhatsThis::add( m_pbtnRemove, i18n("Click here to remove the selected key bindings scheme. You cannot" + " remove the standard system-wide schemes 'Current scheme' and 'KDE default'.") ); + pHLayout->addWidget( m_pbtnRemove ); + + pHLayout->addSpacing( KDialog::marginHint() * 3 ); + + m_prbNew = new QRadioButton( i18n("New scheme"), this ); + m_prbNew->setEnabled( false ); + pGroup->insert( m_prbNew ); + pHLayout->addWidget( m_prbNew ); + + m_pbtnSave = new QPushButton( i18n("&Save..."), this ); + m_pbtnSave->setEnabled( false ); + QWhatsThis::add( m_pbtnSave, i18n("Click here to add a new key bindings scheme. You will be prompted for a name.") ); + connect( m_pbtnSave, SIGNAL(clicked()), SLOT(slotSaveSchemeAs()) ); + pHLayout->addWidget( m_pbtnSave ); + + pHLayout->addStretch( 1 ); + + m_pTab = new QTabWidget( this ); + m_pTab->setMargin( KDialog::marginHint() ); + pVLayout->addWidget( m_pTab ); + + m_pListGeneral = new KAccelShortcutList( m_actionsGeneral, true ); + m_pkcGeneral = new KKeyChooser( m_pListGeneral, this, KKeyChooser::Global, false ); + m_pTab->addTab( m_pkcGeneral, i18n("&Global Shortcuts") ); + connect( m_pkcGeneral, SIGNAL(keyChange()), SLOT(slotKeyChange()) ); + + m_pListSequence = new KAccelShortcutList( m_actionsSequence, true ); + m_pkcSequence = new KKeyChooser( m_pListSequence, this, KKeyChooser::Global, false ); + m_pTab->addTab( m_pkcSequence, i18n("Shortcut Se&quences") ); + connect( m_pkcSequence, SIGNAL(keyChange()), SLOT(slotKeyChange()) ); + + m_pListApplication = new KStdAccel::ShortcutList; + m_pkcApplication = new KKeyChooser( m_pListApplication, this, KKeyChooser::Standard, false ); + m_pTab->addTab( m_pkcApplication, i18n("App&lication Shortcuts") ); + connect( m_pkcApplication, SIGNAL(keyChange()), SLOT(slotKeyChange()) ); + + kdDebug(125) << "G-----------" << endl; + readSchemeNames(); + + kdDebug(125) << "I-----------" << endl; + slotSchemeCur(); + + kdDebug(125) << "J-----------" << endl; +} + +void ShortcutsModule::createActionsGeneral() +{ + KAccelActions& actions = m_actionsGeneral; + + for( uint i = 0; i < actions.count(); i++ ) { + QString sConfigKey = actions[i].name(); + //kdDebug(125) << "sConfigKey: " << sConfigKey << endl; + int iLastSpace = sConfigKey.findRev( ' ' ); + bool bIsNum = false; + if( iLastSpace >= 0 ) + sConfigKey.mid( iLastSpace+1 ).toInt( &bIsNum ); + + //kdDebug(125) << "sConfigKey: " << sConfigKey + // << " bIsNum: " << bIsNum << endl; + if( bIsNum && !sConfigKey.contains( ':' ) ) { + actions[i].setConfigurable( false ); + actions[i].setName( QString::null ); + } + } +} + +void ShortcutsModule::createActionsSequence() +{ + KAccelActions& actions = m_actionsSequence; + + for( uint i = 0; i < actions.count(); i++ ) { + QString sConfigKey = actions[i].name(); + //kdDebug(125) << "sConfigKey: " << sConfigKey << endl; + int iLastSpace = sConfigKey.findRev( ' ' ); + bool bIsNum = false; + if( iLastSpace >= 0 ) + sConfigKey.mid( iLastSpace+1 ).toInt( &bIsNum ); + + //kdDebug(125) << "sConfigKey: " << sConfigKey + // << " bIsNum: " << bIsNum << endl; + if( !bIsNum && !sConfigKey.contains( ':' ) ) { + actions[i].setConfigurable( false ); + actions[i].setName( QString::null ); + } + } +} + +void ShortcutsModule::readSchemeNames() +{ + QStringList schemes = KGlobal::dirs()->findAllResources("data", "kcmkeys/*.kksrc"); + + m_pcbSchemes->clear(); + m_rgsSchemeFiles.clear(); + + i18n("User-Defined Scheme"); + m_pcbSchemes->insertItem( i18n("Current Scheme") ); + m_rgsSchemeFiles.append( "cur" ); + + // This for system files + for ( QStringList::ConstIterator it = schemes.begin(); it != schemes.end(); ++it) { + // KPersonalizer relies on .kksrc files containing all the keyboard shortcut + // schemes for various setups. It also requires the KDE defaults to be in + // a .kksrc file. The KDE defaults shouldn't be listed here. + //if( r.search( *it ) != -1 ) + // continue; + + KSimpleConfig config( *it, true ); + config.setGroup( "Settings" ); + QString str = config.readEntry( "Name" ); + + m_pcbSchemes->insertItem( str ); + m_rgsSchemeFiles.append( *it ); + } +} + +void ShortcutsModule::resizeEvent( QResizeEvent * ) +{ + //m_pTab->setGeometry(0,0,width(),height()); +} + +void ShortcutsModule::slotSchemeCur() +{ + kdDebug(125) << "ShortcutsModule::slotSchemeCur()" << endl; + //m_pcbSchemes->setCurrentItem( 0 ); + slotSelectScheme(); +} + +void ShortcutsModule::slotKeyChange() +{ + kdDebug(125) << "ShortcutsModule::slotKeyChange()" << endl; + m_prbNew->setEnabled( true ); + m_prbNew->setChecked( true ); + m_pbtnSave->setEnabled( true ); + emit changed( true ); +} + +void ShortcutsModule::slotSelectScheme( int ) +{ + i18n("Your current changes will be lost if you load another scheme before saving this one."); + kdDebug(125) << "ShortcutsModule::slotSelectScheme( " << m_pcbSchemes->currentItem() << " )" << endl; + QString sFilename = m_rgsSchemeFiles[ m_pcbSchemes->currentItem() ]; + + if( sFilename == "cur" ) { + // TODO: remove nulls params + m_pkcGeneral->syncToConfig( "Global Shortcuts", 0, true ); + m_pkcSequence->syncToConfig( "Global Shortcuts", 0, true ); + m_pkcApplication->syncToConfig( "Shortcuts", 0, false ); + } else { + KSimpleConfig config( sFilename ); + config.setGroup( "Settings" ); + //m_sBaseSchemeFile = config.readEntry( "Name" ); + + // If the user's keyboard layout doesn't support the Win key, + // but this layout scheme requires it, + if( !KKeyNative::keyboardHasWinKey() + && config.readBoolEntry( "Uses Win Modifier", false ) ) { + // TODO: change "Win" to Win's label. + int ret = KMessageBox::warningContinueCancel( this, + i18n("This scheme requires the \"%1\" modifier key, which is not " + "available on your keyboard layout. Do you wish to view it anyway?" ) + .arg(i18n("Win")) ); + if( ret == KMessageBox::Cancel ) + return; + } + + m_pkcGeneral->syncToConfig( "Global Shortcuts", &config, true ); + m_pkcSequence->syncToConfig( "Global Shortcuts", &config, true ); + m_pkcApplication->syncToConfig( "Shortcuts", &config, false ); + } + + m_prbPre->setChecked( true ); + m_prbNew->setEnabled( false ); + m_pbtnSave->setEnabled( false ); + emit changed(true); +} + +void ShortcutsModule::slotSaveSchemeAs() +{ + QString sName, sFile; + bool bNameValid, ok; + int iScheme = -1; + + sName = m_pcbSchemes->currentText(); + + do { + bNameValid = true; + + sName = KInputDialog::getText( i18n( "Save Key Scheme" ), + i18n( "Enter a name for the key scheme:" ), sName, &ok, this ); + + if( ok ) { + sName = sName.simplifyWhiteSpace(); + sFile = sName; + + int ind = 0; + while( ind < (int) sFile.length() ) { + // parse the string for first white space + ind = sFile.find(" "); + if( ind == -1 ) { + ind = sFile.length(); + break; + } + + // remove from string + sFile.remove( ind, 1 ); + + // Make the next letter upper case + QString s = sFile.mid( ind, 1 ); + s = s.upper(); + sFile.replace( ind, 1, s ); + } + + iScheme = -1; + for( int i = 0; i < (int) m_pcbSchemes->count(); i++ ) { + if( sName.lower() == (m_pcbSchemes->text(i)).lower() ) { + iScheme = i; + + int result = KMessageBox::warningContinueCancel( 0, + i18n("A key scheme with the name '%1' already exists;\n" + "do you want to overwrite it?\n").arg(sName), + i18n("Save Key Scheme"), + i18n("Overwrite")); + bNameValid = (result == KMessageBox::Continue); + } + } + } else + return; + } while( !bNameValid ); + + disconnect( m_pcbSchemes, SIGNAL(activated(int)), this, SLOT(slotSelectScheme(int)) ); + + QString kksPath = KGlobal::dirs()->saveLocation( "data", "kcmkeys/" ); + + QDir dir( kksPath ); + if( !dir.exists() && !dir.mkdir( kksPath ) ) { + qWarning("KShortcutsModule: Could not make directory to store user info."); + return; + } + + sFile.prepend( kksPath ); + sFile += ".kksrc"; + if( iScheme == -1 ) { + m_pcbSchemes->insertItem( sName ); + //m_pcbSchemes->setFocus(); + m_pcbSchemes->setCurrentItem( m_pcbSchemes->count()-1 ); + m_rgsSchemeFiles.append( sFile ); + } else { + //m_pcbSchemes->setFocus(); + m_pcbSchemes->setCurrentItem( iScheme ); + } + + KSimpleConfig *config = new KSimpleConfig( sFile ); + + config->setGroup( "Settings" ); + config->writeEntry( "Name", sName ); + delete config; + + saveScheme(); + + connect( m_pcbSchemes, SIGNAL(activated(int)), SLOT(slotSelectScheme(int)) ); + slotSelectScheme(); +} + +void ShortcutsModule::saveScheme() +{ + QString sFilename = m_rgsSchemeFiles[ m_pcbSchemes->currentItem() ]; + KSimpleConfig config( sFilename ); + + m_pkcGeneral->commitChanges(); + m_pkcSequence->commitChanges(); + m_pkcApplication->commitChanges(); + + m_pListGeneral->writeSettings( "Global Shortcuts", &config, true ); + m_pListSequence->writeSettings( "Global Shortcuts", &config, true ); + m_pListApplication->writeSettings( "Shortcuts", &config, true ); +} + +void ShortcutsModule::slotRemoveScheme() +{ +} + +#include "shortcuts.moc" diff --git a/kcontrol/keys/shortcuts.h b/kcontrol/keys/shortcuts.h new file mode 100644 index 000000000..a16a619e3 --- /dev/null +++ b/kcontrol/keys/shortcuts.h @@ -0,0 +1,77 @@ +/* + * shortcuts.h + * + * Copyright (c) 1999 Matthias Hoelzer-Kluepfel <hoelzer@kde.org> + * + * Requires the Qt widget libraries, available at no cost at + * http://www.troll.no/ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef __SHORTCUTS_MODULE_H +#define __SHORTCUTS_MODULE_H + +#include <qbuttongroup.h> +#include <qpushbutton.h> +#include <qradiobutton.h> +#include <qtabwidget.h> +#include "kaccelaction.h" +#include <kcombobox.h> +#include <kkeydialog.h> + +class ShortcutsModule : public QWidget +{ + Q_OBJECT + public: + ShortcutsModule( QWidget *parent = 0, const char *name = 0 ); + ~ShortcutsModule(); + + void load(); + void save(); + void defaults(); + QString quickHelp() const; + + protected: + void initGUI(); + void createActionsGeneral(); + void createActionsSequence(); + void readSchemeNames(); + void saveScheme(); + void resizeEvent(QResizeEvent *e); + + signals: + void changed( bool ); + + protected slots: + void slotSchemeCur(); + void slotKeyChange(); + void slotSelectScheme( int = 0 ); + void slotSaveSchemeAs(); + void slotRemoveScheme(); + + private: + QTabWidget* m_pTab; + QRadioButton *m_prbPre, *m_prbNew; + KComboBox* m_pcbSchemes; + QPushButton* m_pbtnSave, * m_pbtnRemove; + int m_nSysSchemes; + QStringList m_rgsSchemeFiles; + KAccelActions m_actionsGeneral, m_actionsSequence;//, m_actionsApplication; + KShortcutList* m_pListGeneral, * m_pListSequence, * m_pListApplication; + KKeyChooser* m_pkcGeneral, * m_pkcSequence, * m_pkcApplication; +}; + +#endif // __SHORTCUTS_MODULE_H diff --git a/kcontrol/keys/treeview.cpp b/kcontrol/keys/treeview.cpp new file mode 100644 index 000000000..0c2056766 --- /dev/null +++ b/kcontrol/keys/treeview.cpp @@ -0,0 +1,282 @@ +/* + * Copyright (C) 2000 Matthias Elter <elter@kde.org> + * Copyright (C) 2001-2002 Raffaele Sandrini <sandrini@kde.org) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include <unistd.h> + +#include <qdir.h> +#include <qimage.h> +#include <qstringlist.h> +#include <qcursor.h> + +#include <kstandarddirs.h> +#include <klocale.h> +#include <kiconloader.h> +#include <kservicegroup.h> + +#include "treeview.h" +#include "treeview.moc" +#include "khotkeys.h" + +AppTreeItem::AppTreeItem(QListViewItem *parent, const QString& storageId) + : KListViewItem(parent), m_init(false), m_storageId(storageId) {} + +AppTreeItem::AppTreeItem(QListViewItem *parent, QListViewItem *after, const QString& storageId) + : KListViewItem(parent, after), m_init(false), m_storageId(storageId) {} + +AppTreeItem::AppTreeItem(QListView *parent, const QString& storageId) + : KListViewItem(parent), m_init(false), m_storageId(storageId) {} + +AppTreeItem::AppTreeItem(QListView *parent, QListViewItem *after, const QString& storageId) + : KListViewItem(parent, after), m_init(false), m_storageId(storageId) {} + +void AppTreeItem::setName(const QString &name) +{ + m_name = name; + setText(0, m_name); +} + +void AppTreeItem::setAccel(const QString &accel) +{ + m_accel = accel; + int temp = accel.find(';'); + if (temp != -1) + { + setText(1, accel.left(temp)); + setText(2, accel.right(accel.length() - temp - 1)); + } + else + { + setText(1, m_accel); + setText(2, QString::null); + } +} + +void AppTreeItem::setOpen(bool o) +{ + if (o && !m_directoryPath.isEmpty() && !m_init) + { + m_init = true; + AppTreeView *tv = static_cast<AppTreeView *>(listView()); + tv->fillBranch(m_directoryPath, this); + } + QListViewItem::setOpen(o); +} + +static QPixmap appIcon(const QString &iconName) +{ + QPixmap normal = SmallIcon( iconName ); + // make sure they are not larger than 20x20 + if (normal.width() > 20 || normal.height() > 20) + { + QImage tmp = normal.convertToImage(); + tmp = tmp.smoothScale(20, 20); + normal.convertFromImage(tmp); + } + return normal; +} + + +AppTreeView::AppTreeView( QWidget *parent, const char *name ) + : KListView(parent, name) +{ + setFrameStyle(QFrame::WinPanel | QFrame::Sunken); + setAllColumnsShowFocus(true); + setRootIsDecorated(true); + setSorting(-1); + setAcceptDrops(false); + setDragEnabled(false); + setMinimumWidth(240); + setResizeMode(AllColumns); + + addColumn(i18n("Command")); + addColumn(i18n("Shortcut")); + addColumn(i18n("Alternate")); + + connect(this, SIGNAL(clicked( QListViewItem* )), + SLOT(itemSelected( QListViewItem* ))); + + connect(this,SIGNAL(selectionChanged ( QListViewItem * )), + SLOT(itemSelected( QListViewItem* ))); +} + +AppTreeView::~AppTreeView() +{ +} + +void AppTreeView::fill() +{ + QApplication::setOverrideCursor(Qt::WaitCursor); + clear(); + fillBranch(QString::null, 0); + QApplication::restoreOverrideCursor(); +} + +void AppTreeView::fillBranch(const QString& rPath, AppTreeItem *parent) +{ + // get rid of leading slash in the relative path + QString relPath = rPath; + if(relPath[0] == '/') + relPath = relPath.mid(1, relPath.length()); + + // We ask KSycoca to give us all services (sorted). + KServiceGroup::Ptr root = KServiceGroup::group(relPath); + + if (!root || !root->isValid()) + return; + + KServiceGroup::List list = root->entries(true); + + QListViewItem *after = 0; + + for(KServiceGroup::List::ConstIterator it = list.begin(); + it != list.end(); ++it) + { + KSycocaEntry * e = *it; + + if (e->isType(KST_KServiceGroup)) + { + KServiceGroup::Ptr g(static_cast<KServiceGroup *>(e)); + QString groupCaption = g->caption(); + + // Item names may contain ampersands. To avoid them being converted + // to accelerators, replace them with two ampersands. + groupCaption.replace("&", "&&"); + + AppTreeItem *item; + if (parent == 0) + item = new AppTreeItem(this, after, QString::null); + else + item = new AppTreeItem(parent, after, QString::null); + + item->setName(groupCaption); + item->setPixmap(0, appIcon(g->icon())); + item->setDirectoryPath(g->relPath()); + item->setExpandable(true); + after = item; + } + else if (e->isType(KST_KService)) + { + KService::Ptr s(static_cast<KService *>(e)); + QString serviceCaption = s->name(); + + // Item names may contain ampersands. To avoid them being converted + // to accelerators, replace them with two ampersands. + serviceCaption.replace("&", "&&"); + + AppTreeItem* item; + if (parent == 0) + item = new AppTreeItem(this, after, s->storageId()); + else + item = new AppTreeItem(parent, after, s->storageId()); + + item->setName(serviceCaption); + item->setAccel(KHotKeys::getMenuEntryShortcut(s->storageId())); + item->setPixmap(0, appIcon(s->icon())); + + after = item; + } + } +} + +void AppTreeView::itemSelected(QListViewItem *item) +{ + AppTreeItem *_item = static_cast<AppTreeItem*>(item); + + if(!item) return; + + emit entrySelected(_item->storageId(), _item->accel(), _item->isDirectory()); +} + +QStringList AppTreeView::fileList(const QString& rPath) +{ + QString relativePath = rPath; + + // truncate "/.directory" + int pos = relativePath.findRev("/.directory"); + if (pos > 0) relativePath.truncate(pos); + + QStringList filelist; + + // loop through all resource dirs and build a file list + QStringList resdirlist = KGlobal::dirs()->resourceDirs("apps"); + for (QStringList::ConstIterator it = resdirlist.begin(); it != resdirlist.end(); ++it) + { + QDir dir((*it) + "/" + relativePath); + if(!dir.exists()) continue; + + dir.setFilter(QDir::Files); + dir.setNameFilter("*.desktop;*.kdelnk"); + + // build a list of files + QStringList files = dir.entryList(); + for (QStringList::ConstIterator it = files.begin(); it != files.end(); ++it) { + // does not work?! + //if (filelist.contains(*it)) continue; + + if (relativePath.isEmpty()) { + filelist.remove(*it); // hack + filelist.append(*it); + } + else { + filelist.remove(relativePath + "/" + *it); //hack + filelist.append(relativePath + "/" + *it); + } + } + } + return filelist; +} + +QStringList AppTreeView::dirList(const QString& rPath) +{ + QString relativePath = rPath; + + // truncate "/.directory" + int pos = relativePath.findRev("/.directory"); + if (pos > 0) relativePath.truncate(pos); + + QStringList dirlist; + + // loop through all resource dirs and build a subdir list + QStringList resdirlist = KGlobal::dirs()->resourceDirs("apps"); + for (QStringList::ConstIterator it = resdirlist.begin(); it != resdirlist.end(); ++it) + { + QDir dir((*it) + "/" + relativePath); + if(!dir.exists()) continue; + dir.setFilter(QDir::Dirs); + + // build a list of subdirs + QStringList subdirs = dir.entryList(); + for (QStringList::ConstIterator it = subdirs.begin(); it != subdirs.end(); ++it) { + if ((*it) == "." || (*it) == "..") continue; + // does not work?! + // if (dirlist.contains(*it)) continue; + + if (relativePath.isEmpty()) { + dirlist.remove(*it); //hack + dirlist.append(*it); + } + else { + dirlist.remove(relativePath + "/" + *it); //hack + dirlist.append(relativePath + "/" + *it); + } + } + } + return dirlist; +} diff --git a/kcontrol/keys/treeview.h b/kcontrol/keys/treeview.h new file mode 100644 index 000000000..d376bc00d --- /dev/null +++ b/kcontrol/keys/treeview.h @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2000 Matthias Elter <elter@kde.org> + * Copyright (C) 2001-2002 Raffaele Sandrini <sandrini@kde.org) + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef __treeview_h__ +#define __treeview_h__ + +#include <qstring.h> +#include <klistview.h> + +class QPopupMenu; +class KActionCollection; +class KDesktopFile; + +class AppTreeItem : public KListViewItem +{ + +public: + AppTreeItem(QListViewItem *parent, const QString& storageId); + AppTreeItem(QListViewItem *parent, QListViewItem *after, const QString& storageId); + AppTreeItem(QListView *parent, const QString& storageId); + AppTreeItem(QListView *parent, QListViewItem* after, const QString& storageId); + + QString storageId() const { return m_storageId; } + void setDirectoryPath(const QString& path) { m_directoryPath = path; } + + QString name() const { return m_name; } + void setName(const QString &name); + + QString accel() const { return m_accel; } + void setAccel(const QString &accel); + + bool isDirectory() const { return !m_directoryPath.isEmpty(); } + + virtual void setOpen(bool o); + +private: + bool m_init : 1; + QString m_storageId; + QString m_name; + QString m_directoryPath; + QString m_accel; +}; + +class AppTreeView : public KListView +{ + friend class AppTreeItem; + Q_OBJECT +public: + AppTreeView(QWidget *parent=0, const char *name=0); + ~AppTreeView(); + void fill(); + +signals: + void entrySelected(const QString&, const QString &, bool); + +protected slots: + void itemSelected(QListViewItem *); + +protected: + void fillBranch(const QString& relPath, AppTreeItem* parent); + + QStringList fileList(const QString& relativePath); + QStringList dirList(const QString& relativePath); +}; + + +#endif diff --git a/kcontrol/keys/unix3.kksrc b/kcontrol/keys/unix3.kksrc new file mode 100644 index 000000000..8ac722ec6 --- /dev/null +++ b/kcontrol/keys/unix3.kksrc @@ -0,0 +1,198 @@ +[Settings] +Name=UNIX Scheme +Name[af]=UNIX Tema +Name[be]=Схема UNIX +Name[bg]=UNIX +Name[bn]=ইউনিক্স স্কীম +Name[br]=Steuñv UNIX +Name[bs]=UNIX šema +Name[ca]=Esquema UNIX +Name[cs]=Unixové schéma +Name[csb]=Mòtiw Uniksa +Name[cy]=Cynllun UNIX +Name[da]=UNIX-system +Name[de]=UNIX-Design +Name[el]=UNIX Μορφή +Name[eo]=Uniksa aranĝo +Name[es]=Esquema UNIX +Name[et]=UNIX-i skeem +Name[eu]=UNIX eskema +Name[fa]=طرحوارۀ یونیکس +Name[fi]=UNIX-skeema +Name[fr]=Thème UNIX +Name[fy]=UNIX-skema +Name[ga]=Scéim UNIX +Name[gl]=Esquema UNIX +Name[he]=ערכת UNIX +Name[hr]=UNIX shema +Name[hu]=UNIX +Name[id]=Skema UNIX +Name[is]=UNIX þema +Name[it]=Schema UNIX +Name[ja]=UNIX スキーマ +Name[ka]=UNIX სქემა +Name[kk]=UNIX сұлбасы +Name[km]=គំនូរបំព្រួញ UNIX +Name[ko]=UNIX 배열 +Name[lo]=ຊຸດຮູບແບບ KWM +Name[lt]=UNIX schema +Name[mk]=UNIX-шема +Name[mn]=UNIX-Схем +Name[nb]=UNIX-oppsett +Name[nds]=UNIX-Vörbild +Name[ne]=यूनिक्स योजना +Name[nl]=UNIX-schema +Name[nn]=UNIX-oppsett +Name[nso]=Leano la UNIX +Name[pa]=UNIX ਸਰੂਪ +Name[pl]=Motyw Uniksa +Name[pt]=Esquema do UNIX +Name[pt_BR]=Esquema UNIX +Name[ro]=Schemă UNIX +Name[ru]=UNIX +Name[rw]=Igishushanyombonera UNIX +Name[se]=UNIX-čoahkkáldat +Name[sk]=UNIX schéma +Name[sl]=Shema UNIX +Name[sr]=UNIX-овска шема +Name[sr@Latn]=UNIX-ovska šema +Name[sv]=Unix schema +Name[tg]=Нақшаи UNIX +Name[th]=ใช้แบบของ UNIX +Name[tr]=UNIX Şeması +Name[tt]=UNIX buyınça +Name[uk]=Схема UNIX +Name[uz]=UNIX mavzusi +Name[uz@cyrillic]=UNIX мавзуси +Name[ven]=Tshikimu tsha UNIX +Name[vi]=Phối hợp của Unix +Name[wa]=Tinme UNIX +Name[xh]=Udweliso lwe UNIX +Name[zh_CN]=Unix 方案 +Name[zh_TW]=UNIX 按鍵配置 +Name[zu]=iplani le-UNIX +Uses Win Modifier=false + +[Global Shortcuts] +Desktop Screenshot=none +Enable/Disable Clipboard Actions=none +Run Command=Alt+F2 +Halt Computer=none +Halt without Confirmation=none +Kill Window=Alt+F9 +Lock Session=Alt+Ctrl+L +Logout=Alt+Ctrl+Delete +Logout without Confirmation=none +Manually Invoke Action on Current Clipboard=Alt+Ctrl+R +Mouse Emulation=Alt+F12 +Popup Launch Menu=Alt+F1 +Reboot Computer=none +Reboot without Confirmation=none +Show Klipper Popup-Menu=none +Show Taskmanager=Ctrl+Escape +Show Window List=none +Switch One Desktop Down=none +Switch One Desktop to the Left=none +Switch One Desktop to the Right=none +Switch One Desktop Up=none +Switch to Next Keyboard Layout=Alt+Ctrl+K +Switch to Desktop 1=Ctrl+F1 +Switch to Desktop 10=Ctrl+F10 +Switch to Desktop 11=Ctrl+F11 +Switch to Desktop 12=Ctrl+F12 +Switch to Desktop 13=Ctrl+Shift+F1 +Switch to Desktop 14=Ctrl+Shift+F2 +Switch to Desktop 15=Ctrl+Shift+F3 +Switch to Desktop 16=Ctrl+Shift+F4 +Switch to Desktop 2=Ctrl+F2 +Switch to Desktop 3=Ctrl+F3 +Switch to Desktop 4=Ctrl+F4 +Switch to Desktop 5=Ctrl+F5 +Switch to Desktop 6=Ctrl+F6 +Switch to Desktop 7=Ctrl+F7 +Switch to Desktop 8=Ctrl+F8 +Switch to Desktop 9=Ctrl+F9 +Switch to Next Desktop=none +Switch to Previous Desktop=none +Toggle Showing Desktop=Alt+Ctrl+D +Toggle Window Raise/Lower=none +Walk Through Desktop List=none +Walk Through Desktop List (Reverse)=Ctrl+Shift+Tab +Walk Through Desktops=Ctrl+Tab +Walk Through Desktops (Reverse)=none +Walk Through Windows=Alt+F11 +Walk Through Windows (Reverse)=Alt+Shift+Tab +Window Close=none +Window Iconify=Alt+F4 +Window Lower=none +Window Maximize=Alt+Shift+F3 +Window Maximize Horizontal=none +Window Maximize Vertical=none +Window Move=Alt+F5 +Window Operations Menu=none +Window Raise=none +Window Resize=Alt+F6 +Window Screenshot=none +Window Shade=none +Window to Desktop 1=none +Window to Desktop 10=none +Window to Desktop 11=none +Window to Desktop 12=none +Window to Desktop 13=none +Window to Desktop 14=none +Window to Desktop 15=none +Window to Desktop 16=none +Window to Desktop 2=none +Window to Desktop 3=none +Window to Desktop 4=none +Window to Desktop 5=none +Window to Desktop 6=none +Window to Desktop 7=none +Window to Desktop 8=none +Window to Desktop 9=none +Window to Next Desktop=none +Window to Previous Desktop=none + +[Shortcuts] +AddBookmark=Ctrl+B +Back=Alt+Left +Close=Ctrl+W +Copy=Ctrl+C +Cut=Ctrl+X +DeleteWordBack=Ctrl+Backspace +DeleteWordForward=Ctrl+Delete +Deselect=Ctrl+Shift+A +End=Ctrl+End +Find=Ctrl+S +FindNext=F3 +FindPrev=Shift+F3 +Forward=Alt+Right +GotoLine=Ctrl+G +Help=F1 +Home=Ctrl+Home +Insert=Ctrl+Insert +New=Ctrl+N +Next=Next +NextCompletion=Ctrl+Down +Open=Ctrl+O +Paste=Ctrl+V +PopupMenuContext=Menu +PrevCompletion=Ctrl+Up +Print=Ctrl+P +Prior=Prior +Quit=Ctrl+Q +Redo=Ctrl+Shift+Z +Reload=F5 +Replace=Ctrl+R +RotateDown=Down +RotateUp=Up +Save=Ctrl+S +SelectAll= +ShowMenubar=Ctrl+M +SubstringCompletion=Ctrl+T +TextCompletion=Ctrl+E +Undo=Ctrl+Z +Up=Alt+Up +WhatsThis=Shift+F1 +ZoomIn=Ctrl+Plus +ZoomOut=Ctrl+Minus diff --git a/kcontrol/keys/win3.kksrc b/kcontrol/keys/win3.kksrc new file mode 100644 index 000000000..926f83670 --- /dev/null +++ b/kcontrol/keys/win3.kksrc @@ -0,0 +1,198 @@ +[Settings] +Name=Windows Scheme (Without Win Key) +Name[af]=Venster Skema (Sonder Win Sleutel) +Name[be]=Схема Windows (без клавішы "Win") +Name[bg]=Windows (без клавиша Win) +Name[bn]=উইণ্ডোস্ স্কীম (উইন্ কী ব্যতীত) +Name[br]=Steuñv Windows (hep stokell Win) +Name[bs]=Windows šema (bez Win tipke) +Name[ca]=Esquema Windows (sense la tecla Win) +Name[cs]=Schéma Windows (bez klávesy Win) +Name[csb]=Mòtiw Windows (bez klawiszë Win) +Name[cy]=Cynllun Windows (Heb Allwedd Win) +Name[da]=Windows-system (uden Win-tast) +Name[de]=Windows-Design (ohne Windows-Taste) +Name[el]=Μορφή Windows (Δίχως Win Πλήκτρο) +Name[eo]=Vindoza aranĝo (sen Vindozoklavo) +Name[es]=Esquema Windows (Sin tecla Win) +Name[et]=Windowsi skeem (ilma Win-klahvita) +Name[eu]=Windows eskema (Win teklarik gabe) +Name[fa]=طرحوارۀ ویندوز( بدون کلید پنجره) +Name[fi]=Windows-skeema (ilman Win-näppäintä) +Name[fr]=Thème Windows (sans la touche « Win ») +Name[fy]=Windows-skema (sûnder Win-toets) +Name[ga]=Scéim Windows (Gan Eochair Win) +Name[gl]=Esquema Windows (Sen Tecla de Windows) +Name[he]=ערכת חלונות (ללא מקש Win) +Name[hr]=Windows shema (bez Windows tipki) +Name[hu]=Windows (Win billentyű nélkül) +Name[id]=Skema Windows (Tanpa Tombol Win) +Name[is]=Windowsþema (án Win lykils) +Name[it]=Schema Windows (senza tasto Win) +Name[ja]=Windows スキーマ (Win キーなし) +Name[kk]=Windows сұлбасы (Win пернесіз) +Name[km]=គំនូរបំព្រួញ Windows (គ្មានគ្រាប់ចុចរូបបង្អួច) +Name[ko]=윈도 배열 (윈도 키 사용 안함) +Name[lo]=ຊຸດຮູບແບບວິນໂດ (ບໍ່ມີປຸ່ມ Win) +Name[lt]=Windows schema (be Win klavišo) +Name[mk]=Windows-шема (без копчето Win) +Name[mn]=Windows-Схем (Win-товчгүй) +Name[ms]=Skim Tetingkap (Tanpa Kekunci Win) +Name[nb]=Windows-oppsett (uten Windows-tast) +Name[nds]=Windows-Vörbild (ahn Windows-Tast) +Name[ne]=विण्डोज योजना (विन कुञ्जी बाहेक) +Name[nl]=Windows-schema (zonder Win-toets) +Name[nn]=Windows-oppsett (utan Windows-tast) +Name[nso]=Leano la Window (Kantle le Senotlelo sa Phenyo) +Name[pa]=Windows ਸਕੀਮ (ਬਿਨਾਂ Win ਸਵਿੱਚ) +Name[pl]=Motyw Windows (bez klawisza Win) +Name[pt]=Esquema do Windows (Sem Tecla Win) +Name[pt_BR]=Esquema Windows (sem a tecla Win) +Name[ro]=Schemă Windows (fără tasta Win) +Name[ru]=Windows (без клавиши Win) +Name[rw]=Igishushanyombonera cy'Amadirishya (Nta Buto Win) +Name[se]=Windows-čoakkáldat (Windows-boalu haga) +Name[sk]=Windows schéma (bez klávesu Win) +Name[sl]=Shema Windows (brez tipke Win) +Name[sr]=Windows-ова шема (без тастера Win) +Name[sr@Latn]=Windows-ova šema (bez tastera Win) +Name[sv]=Windows schema (utan Win-tangent) +Name[tg]=Нақшаи тирезаҳо (Бе калиди Win) +Name[th]=ใช้แบบของวินโดวส์ (ไม่มีปุ่ม Win) +Name[tr]=Windows Şeması (Win Key'siz) +Name[tt]=Windows buyınça (Win-töymäsez) +Name[uk]=Схема Windows (без клавіші Win) +Name[uz]=Windows qolipi (Win tugmasi bilan) +Name[uz@cyrillic]=Windows қолипи (Win тугмаси билан) +Name[ven]=Tshikimu tsha dziWindo (isina Meta/Win-Key) +Name[vi]=Phối hợp của Windows (không có phím Cửa sổ) +Name[wa]=Tinme Windows (sins l' tape Win) +Name[xh]=Window Yodweliso (Ngaphandle kwe Win key) +Name[zh_CN]=Windows 方案(无 Win 键) +Name[zh_TW]=Windows 按鍵配置 (無 Win 鍵) +Name[zu]=Iplani lama-Window (Ngaphandle kukakhiye we-Win) +Uses Win Modifier=false + +[Global Shortcuts] +Desktop Screenshot=Ctrl+Print +Enable/Disable Clipboard Actions=none +Run Command=none +Halt Computer=none +Halt without Confirmation=none +Kill Window=none +Lock Session=none +Logout=none +Logout without Confirmation=none +Manually Invoke Action on Current Clipboard=none +Mouse Emulation=none +Popup Launch Menu=Ctrl+Escape +Reboot Computer=none +Reboot without Confirmation=none +Show Klipper Popup-Menu=none +Show Taskmanager=Alt+Ctrl+Delete +Show Window List=none +Switch One Desktop Down=none +Switch One Desktop to the Left=none +Switch One Desktop to the Right=none +Switch One Desktop Up=none +Switch to Next Keyboard Layout=Alt+Ctrl+K +Switch to Desktop 1=none +Switch to Desktop 10=none +Switch to Desktop 11=none +Switch to Desktop 12=none +Switch to Desktop 13=none +Switch to Desktop 14=none +Switch to Desktop 15=none +Switch to Desktop 16=none +Switch to Desktop 2=none +Switch to Desktop 3=none +Switch to Desktop 4=none +Switch to Desktop 5=none +Switch to Desktop 6=none +Switch to Desktop 7=none +Switch to Desktop 8=none +Switch to Desktop 9=none +Switch to Next Desktop=Alt+Shift+Tab +Switch to Previous Desktop=none +Toggle Showing Desktop=Alt+Ctrl+D +Toggle Window Raise/Lower=none +Walk Through Desktop List=none +Walk Through Desktop List (Reverse)=none +Walk Through Desktops=Alt+Ctrl+Tab +Walk Through Desktops (Reverse)=Alt+Ctrl+Shift+Tab +Walk Through Windows=Alt+Tab +Walk Through Windows (Reverse)=Alt+Shift+Tab +Window Close=Alt+F4 +Window Iconify=none +Window Lower=none +Window Maximize=none +Window Maximize Horizontal=none +Window Maximize Vertical=none +Window Move=none +Window Operations Menu=Alt+Space +Window Raise=none +Window Resize=none +Window Screenshot=Alt+Print +Window Shade=none +Window to Desktop 1=none +Window to Desktop 10=none +Window to Desktop 11=none +Window to Desktop 12=none +Window to Desktop 13=none +Window to Desktop 14=none +Window to Desktop 15=none +Window to Desktop 16=none +Window to Desktop 2=none +Window to Desktop 3=none +Window to Desktop 4=none +Window to Desktop 5=none +Window to Desktop 6=none +Window to Desktop 7=none +Window to Desktop 8=none +Window to Desktop 9=none +Window to Next Desktop=none +Window to Previous Desktop=none + +[Shortcuts] +AddBookmark=Ctrl+D +Back=Alt+Left +Close=Ctrl+F4;Ctrl+W +Copy=Ctrl+C;Ctrl+Insert +Cut=Ctrl+X;Shift+Delete +DeleteWordBack=Ctrl+Backspace +DeleteWordForward=Ctrl+Delete +Deselect=Ctrl+Shift+A +End=Ctrl+End +Find=Ctrl+F +FindNext=F3 +FindPrev=Shift+F3 +Forward=Alt+Right +GotoLine=Ctrl+G +Help=F1 +Home=Ctrl+Home +Insert=Ctrl+Insert +New=Ctrl+N +Next=Next +NextCompletion=Ctrl+Down +Open=Ctrl+O +Paste=Ctrl+V;Shift+Insert +PopupMenuContext=F10 +PrevCompletion=Ctrl+Up +Print=Ctrl+P +Prior=Prior +Quit= +Redo=Ctrl+Shift+Z +Reload=F5 +Replace=Ctrl+R +RotateDown=Down +RotateUp=Up +Save=Ctrl+S +SelectAll=Ctrl+A +ShowMenubar=Ctrl+M +SubstringCompletion=Ctrl+T +TextCompletion=Ctrl+E +Undo=Ctrl+Z +Up=Alt+Up +WhatsThis=Shift+F1 +ZoomIn=Ctrl+Plus +ZoomOut=Ctrl+Minus diff --git a/kcontrol/keys/win4.kksrc b/kcontrol/keys/win4.kksrc new file mode 100644 index 000000000..1abb69313 --- /dev/null +++ b/kcontrol/keys/win4.kksrc @@ -0,0 +1,198 @@ +[Settings] +Name=Windows Scheme (With Win Key) +Name[af]=Windows Skema (Met Win Sleutel) +Name[be]=Схема Windows (з клавішай "Win") +Name[bg]=Windows (с клавиша Win) +Name[bn]=উইণ্ডোস্ স্কীম (উইন্ কী সমেত) +Name[br]=Steuñv Windows (gant stokell Win) +Name[bs]=Windows šema (sa Win tipkom) +Name[ca]=Esquema Windows (amb la tecla Win) +Name[cs]=Schéma Windows (s klávesou Win) +Name[csb]=Mòtiw Windows (z klawiszą Win) +Name[cy]=Cynllun Windows (Gyda'r Allwedd Win) +Name[da]=Windows-system (med Win-tast) +Name[de]=Windows-Design (mit Windows-Taste) +Name[el]=Μορφή Windows (Με Win Πλήκτρο) +Name[eo]=Vindoza aranĝo (kun Vindozoklavo) +Name[es]=Esquema Windows (Con tecla Win) +Name[et]=Windowsi skeem (Win-klahviga) +Name[eu]=Windows eskema (Win teklarekin) +Name[fa]=طرحوارۀ پنجره( با کلید پنجره) +Name[fi]=Windows-skeema (Win-näppäimellä) +Name[fr]=Thème Windows (avec la touche « Win ») +Name[fy]=Windows-skema (mei Win-toets) +Name[ga]=Scéim Windows (Le hEochair Win) +Name[gl]=Esquema de Windows (Con Tecla de Windows) +Name[he]=ערכת חלונות (עם מקש Win) +Name[hr]=Windows shema (s Windows tipkama) +Name[hu]=Windows (Win billentyűvel) +Name[id]=Skema Windows (Dengan Tombol Win) +Name[is]=Windowsþema (með Win lykli) +Name[it]=Schema Windows (con tasto Win) +Name[ja]=Windows スキーマ (Win キーあり) +Name[ka]=Windows სქემა (Win კლავიშით) +Name[kk]=Windows сұлбасы (Win пернемен) +Name[km]=គំនូរបំព្រួញ Windows (មានគ្រាប់ចុចរូបបង្អួច) +Name[ko]=윈도 배열 (윈도 키 사용) +Name[lo]=ຊຸດຮູບແບບວິນໂດ (ມີປຸ່ມ Win) +Name[lt]=Windows schema (su Win klavišu) +Name[mk]=Windows-шема (со копчето Win) +Name[mn]=Windows-Схем (Win-Товчтой) +Name[nb]=Windows-oppsett (med Windows-tast) +Name[nds]=Windows-Vörbild (mit Windows-Tast) +Name[ne]=विण्डोज योजना (विन कुञ्जीसँग) +Name[nl]=Windows-schema (met Win-toets) +Name[nn]=Windows-oppsett (med Windows-tast) +Name[nso]=Leano la Window (Le Senotlelo sa Phenyo) +Name[pa]=Windows ਸਕੀਮ (Win ਸਵਿੱਚ ਨਾਲ) +Name[pl]=Motyw Windows (z klawiszem Win) +Name[pt]=Esquema do Windows (Sem Tecla Win) +Name[pt_BR]=Esquema Windows (com a tecla Win) +Name[ro]=Schemă Windows (cu tasta Win) +Name[ru]=Windows (поддержка клавиши Win) +Name[rw]=Igishushanyombonera cy'Amadirishya (Na Buto Win) +Name[se]=Windows-čoakkáldat (Windows-boaluin) +Name[sk]=Windows schéma (s klávesom Win) +Name[sl]=Shema Windows (s tipko Win) +Name[sr]=Windows-ова шема (са тастером Win) +Name[sr@Latn]=Windows-ova šema (sa tasterom Win) +Name[sv]=Windows schema (med Win-tangent) +Name[tg]=Нақшаи тирезаҳо (Бо калиди Win) +Name[th]=ใช้แบบของวินโดวส์ (มีปุ่ม Win) +Name[tr]=Windows Şeması (Win Key İle) +Name[tt]=Windows buyınça (Win-töymäle) +Name[uk]=Схема Windows (з клавішею Win) +Name[uz]=Windows qolipi (Win tugmasiz) +Name[uz@cyrillic]=Windows қолипи (Win тугмасиз) +Name[ven]=TShikimu tsha dziwindo (irena Meta/Win-Key) +Name[vi]=Phối hợp của Windows (có phím Cửa sổ) +Name[wa]=Tinme Windows (avou l' tape Win) +Name[xh]=Windows Ezingagqibekanga (Nge Win-key) +Name[zh_CN]=Windows 方案(有 Win 键) +Name[zh_TW]=Windows 按鍵配置 (有 Win 鍵) +Name[zu]=Iplani lama-Window (Kukhona ukhiye we-Win) +Uses Win Modifier=true + +[Global Shortcuts] +Desktop Screenshot=Print +Enable/Disable Clipboard Actions=none +Run Command=Win+R +Halt Computer=none +Halt without Confirmation=none +Kill Window=none +Lock Session=none +Logout=none +Logout without Confirmation=none +Manually Invoke Action on Current Clipboard=none +Mouse Emulation=none +Popup Launch Menu=Ctrl+Escape +Reboot Computer=none +Reboot without Confirmation=none +Show Klipper Popup-Menu=none +Show Taskmanager=Alt+Ctrl+Delete +Show Window List=none +Switch One Desktop Down=none +Switch One Desktop to the Left=none +Switch One Desktop to the Right=none +Switch One Desktop Up=none +Switch to Next Keyboard Layout=Alt+Ctrl+K +Switch to Desktop 1=Win+F1 +Switch to Desktop 10=Win+F10 +Switch to Desktop 11=none +Switch to Desktop 12=none +Switch to Desktop 13=none +Switch to Desktop 14=none +Switch to Desktop 15=none +Switch to Desktop 16=none +Switch to Desktop 2=Win+F2 +Switch to Desktop 3=Win+F3 +Switch to Desktop 4=Win+F4 +Switch to Desktop 5=Win+F5 +Switch to Desktop 6=Win+F6 +Switch to Desktop 7=Win+F7 +Switch to Desktop 8=Win+F8 +Switch to Desktop 9=Win+F9 +Switch to Next Desktop=none +Switch to Previous Desktop=none +Toggle Showing Desktop=Win+D;Win+M +Toggle Window Raise/Lower=none +Walk Through Desktop List=none +Walk Through Desktop List (Reverse)=none +Walk Through Desktops=Win+Tab +Walk Through Desktops (Reverse)=Win+Shift+Tab +Walk Through Windows=Alt+Tab +Walk Through Windows (Reverse)=Alt+Shift+Tab +Window Close=Alt+F4 +Window Iconify=none +Window Lower=none +Window Maximize=none +Window Maximize Horizontal=none +Window Maximize Vertical=none +Window Move=none +Window Operations Menu=Alt+Space +Window Raise=none +Window Resize=none +Window Screenshot=Alt+Print +Window Shade=none +Window to Desktop 1=none +Window to Desktop 10=none +Window to Desktop 11=none +Window to Desktop 12=none +Window to Desktop 13=none +Window to Desktop 14=none +Window to Desktop 15=none +Window to Desktop 16=none +Window to Desktop 2=none +Window to Desktop 3=none +Window to Desktop 4=none +Window to Desktop 5=none +Window to Desktop 6=none +Window to Desktop 7=none +Window to Desktop 8=none +Window to Desktop 9=none +Window to Next Desktop=none +Window to Previous Desktop=none + +[Shortcuts] +AddBookmark=Ctrl+D +Back=Alt+Left +Close=Ctrl+F4;Ctrl+W +Copy=Ctrl+C;Ctrl+Insert +Cut=Ctrl+X;Shift+Delete +DeleteWordBack=Ctrl+Backspace +DeleteWordForward=Ctrl+Delete +Deselect=Ctrl+Shift+A +End=Ctrl+End +Find=Ctrl+F +FindNext=F3 +FindPrev=Shift+F3 +Forward=Alt+Right +GotoLine=Ctrl+G +Help=F1 +Home=Ctrl+Home +Insert=Ctrl+Insert +New=Ctrl+N +Next=Next +NextCompletion=Ctrl+Down +Open=Ctrl+O +Paste=Ctrl+V;Shift+Insert +PopupMenuContext=F10 +PrevCompletion=Ctrl+Up +Print=Ctrl+P +Prior=Prior +Quit= +Redo=Ctrl+Shift+Z +Reload=F5 +Replace=Ctrl+R +RotateDown=Down +RotateUp=Up +Save=Ctrl+S +SelectAll=Ctrl+A +ShowMenubar=Ctrl+M +SubstringCompletion=Ctrl+T +TextCompletion=Ctrl+E +Undo=Ctrl+Z +Up=Alt+Up +WhatsThis=Shift+F1 +ZoomIn=Ctrl+Plus +ZoomOut=Ctrl+Minus diff --git a/kcontrol/keys/wm3.kksrc b/kcontrol/keys/wm3.kksrc new file mode 100644 index 000000000..6c6ef61e5 --- /dev/null +++ b/kcontrol/keys/wm3.kksrc @@ -0,0 +1,188 @@ +[Settings] +Name=WindowMaker (3 Modifier Keys) +Name[af]=WindowMaker (3 verandering sleutels) +Name[be]=WindowMaker (тры клавішы мадыфікацыі) +Name[bg]=WindowMaker (с 3 модификационни клавиша) +Name[bn]=উইণ্ডো-মেকার (৩-টি মডিফায়ার কী) +Name[bs]=WindowMaker (3 modificirajuće tipke) +Name[ca]=WindowMaker (3 tecles modificadores) +Name[cs]=WindowMaker (3 modifikátory) +Name[csb]=WindowMaker (3 klawisze zjinaczi) +Name[cy]=WindowMaker (3 Bysell Addasu) +Name[da]=Windowmaker (3 modifikatortaster) +Name[de]=WindowMaker (3 Sondertasten) +Name[el]=WindowMaker (3 πλήκτρα αλλαγής) +Name[eo]=WindoMaker (3 modifaj klavoj) +Name[es]=WindowMaker (3 teclas de modificación) +Name[et]=WindowMaker (3 muuteklahviga) +Name[eu]=WindowMaker (3 tekla modifikatzailekin) +Name[fa]=WindowMaker (۳کلید تغییردهندۀ) +Name[fi]=WindowMaker (3 muokkausnäppäintä) +Name[fr]=WindowMaker (3 touches de modifications) +Name[fy]=WindowMaker (3 modifikaasjetoetsen) +Name[ga]=WindowMaker (3 Eochair Mhionathraithe) +Name[gl]=WindowMaker (3 Teclas Modificadoras) +Name[he]=WindowMaker (עם שלושה מצבים) +Name[hr]=WindowMaker (3 modifikatorske tipke) +Name[hu]=WindowMaker (3 módosító billentyű) +Name[is]=WindowMaker (3 breytilyklar) +Name[it]=WindowMaker (3 tasti modificatori) +Name[ja]=WindowMaker (3 モディファイアキー) +Name[ka]=WindowMaker (3 ცვლადი კლავიში) +Name[kk]=WindowMaker (3 түрлендіру перне) +Name[km]=WindowMaker (គ្រាប់ចុចកែប្រែ ៣) +Name[ko]=WindowMaker (수정자 키 세 개) +Name[lt]=WindowMaker (3 klavišai - modifikatoriai) +Name[mk]=WindowMaker (3 копчиња-модификатори) +Name[mn]=WindowMaker (3 сэлгүүр товчилуур) +Name[nb]=WindowMaker (tre valgtaster) +Name[nds]=WindowMaker (3 Sünnertasten) +Name[ne]=विण्डोज निर्माता (३ परिमार्जक कुञ्जीहरू) +Name[nl]=WindowMaker (3 modificatietoetsen) +Name[nn]=WindowMaker (tre valtastar) +Name[pa]=WindowMaker (3 ਸੋਧ ਸਵਿੱਚਾਂ) +Name[pl]=WindowMaker (3 klawisze modyfikatorów) +Name[pt]=WindowMaker (3 Teclas Modificadoras) +Name[pt_BR]=WindowMaker (3 teclas modificadoras) +Name[ro]=WindowMaker (3 taste modificator) +Name[ru]=WindowMaker (3 клавиши-модификатора) +Name[rw]=MukoraDirishya (Muhindura Buto 3) +Name[se]=WindowMaker (golbma válljenboaluiguin) +Name[sk]=WindowMaker (3 modifikačné klávesy) +Name[sl]=WindowMaker (3 spremenilne tipke) +Name[sr]=WindowMaker (3 модификаторска тастера) +Name[sr@Latn]=WindowMaker (3 modifikatorska tastera) +Name[sv]=Windowmaker (3 väljartangenter) +Name[tg]=СозандаиТиреза (3 калиди ислоҳ) +Name[th]=วินโดวเมคเกอร์ (ใช้ปุ่มเปลี่ยนหน้าที่ 3ปุ่ม) +Name[tr]=WindowMaker (3 Değiştirici Anahtar) +Name[tt]=WindowMaker (3 Üzgärtkeç Töymä) +Name[uk]=WindowMaker (3 модифікатори) +Name[vi]=WindowMaker (3 Phím Bổ trợ) +Name[wa]=WindowMaker (3 tapes di candjmint) +Name[zh_CN]=WindowMaker (三个修饰键) +Name[zh_TW]=WindowMaker (3 個輔助按鍵) + +[Global Shortcuts] +Desktop Screenshot=Ctrl+Print +Enable/Disable Clipboard Actions=Alt+Ctrl+X +Run Command=Alt+F2 +Halt Computer=none +Halt without Confirmation=none +Kill Window=Alt+Ctrl+Escape +Lock Session=Alt+Ctrl+L +Logout=Alt+Ctrl+Delete +Logout without Confirmation=none +Manually Invoke Action on Current Clipboard=Alt+Ctrl+R +Mouse Emulation=Alt+F12 +Popup Launch Menu=Alt+F1 +Reboot Computer=none +Reboot without Confirmation=none +Show Klipper Popup-Menu=Alt+Ctrl+V +Show Taskmanager=Ctrl+Escape +Show Window List=Alt+F5 +Switch One Desktop Down=none +Switch One Desktop to the Left=none +Switch One Desktop to the Right=none +Switch One Desktop Up=none +Switch to Next Keyboard Layout=Alt+Ctrl+K +Switch to Desktop 1=Alt+1 +Switch to Desktop 10=Alt+Shift+1 +Switch to Desktop 11=Alt+Shift+2 +Switch to Desktop 12=Alt+Shift+3 +Switch to Desktop 13=Alt+Shift+4 +Switch to Desktop 14=Alt+Shift+5 +Switch to Desktop 15=Alt+Shift+6 +Switch to Desktop 16=Alt+Shift+7 +Switch to Desktop 2=Alt+2 +Switch to Desktop 3=Alt+3 +Switch to Desktop 4=Alt+4 +Switch to Desktop 5=Alt+5 +Switch to Desktop 6=Alt+6 +Switch to Desktop 7=Alt+7 +Switch to Desktop 8=Alt+8 +Switch to Desktop 9=Alt+9 +Switch to Next Desktop=none +Switch to Previous Desktop=none +Toggle Showing Desktop=Alt+Ctrl+D +Toggle Window Raise/Lower=none +Walk Through Desktop List=Ctrl+Tab +Walk Through Desktop List (Reverse)=Ctrl+Shift+Tab +Walk Through Desktops=none +Walk Through Desktops (Reverse)=none +Walk Through Windows=Alt+Tab +Walk Through Windows (Reverse)=Alt+Shift+Tab +Window Close=Alt+Escape +Window Iconify=none +Window Lower=none +Window Maximize=none +Window Maximize Horizontal=none +Window Maximize Vertical=none +Window Move=none +Window Operations Menu=Alt+F3 +Window Raise=none +Window Resize=none +Window Screenshot=Alt+Print +Window Shade=none +Window to Desktop 1=Alt+Ctrl+1 +Window to Desktop 10=Alt+Ctrl+Shift+1 +Window to Desktop 11=Alt+Ctrl+Shift+2 +Window to Desktop 12=Alt+Ctrl+Shift+3 +Window to Desktop 13=Alt+Ctrl+Shift+4 +Window to Desktop 14=Alt+Ctrl+Shift+5 +Window to Desktop 15=Alt+Ctrl+Shift+6 +Window to Desktop 16=Alt+Ctrl+Shift+7 +Window to Desktop 2=Alt+Ctrl+2 +Window to Desktop 3=Alt+Ctrl+3 +Window to Desktop 4=Alt+Ctrl+4 +Window to Desktop 5=Alt+Ctrl+5 +Window to Desktop 6=Alt+Ctrl+6 +Window to Desktop 7=Alt+Ctrl+7 +Window to Desktop 8=Alt+Ctrl+8 +Window to Desktop 9=Alt+Ctrl+9 +Window to Next Desktop=none +Window to Previous Desktop=none + +[Shortcuts] +AddBookmark=Ctrl+B +Back=Alt+Left +Close=Ctrl+W +Copy=Ctrl+C;Ctrl+Insert +Cut=Ctrl+X;Shift+Delete +DeleteWordBack=Ctrl+Backspace +DeleteWordForward=Ctrl+Delete +Deselect=Ctrl+Shift+A +End=Ctrl+End +Find=Ctrl+F +FindNext=F3 +FindPrev=Shift+F3 +Forward=Alt+Right +GotoLine=Ctrl+G +Help=F1 +Home=Ctrl+Home +Insert=Ctrl+Insert +New=Ctrl+N +Next=Next +NextCompletion=Ctrl+Down +Open=Ctrl+O +Paste=Ctrl+V;Shift+Insert +PopupMenuContext=Menu +PrevCompletion=Ctrl+Up +Print=Ctrl+P +Prior=Prior +Quit=Ctrl+Q +Redo=Ctrl+Shift+Z +Reload=F5 +Replace=Ctrl+R +RotateDown=Down +RotateUp=Up +Save=Ctrl+S +SelectAll=Ctrl+A +ShowMenubar=Ctrl+M +SubstringCompletion=Ctrl+T +TextCompletion=Ctrl+E +Undo=Ctrl+Z +Up=Alt+Up +WhatsThis=Shift+F1 +ZoomIn=Ctrl+Plus +ZoomOut=Ctrl+Minus |