KKeySequence Class Reference
A KKeySequence object holds a sequence of up to 4 keys. More...
#include <kshortcut.h>
Public Types | |
enum | { MAX_KEYS = 4 } |
Public Member Functions | |
KKeySequence () | |
KKeySequence (const QKeySequence &keySeq) | |
KKeySequence (const KKey &key) | |
KKeySequence (const KKeyNative &key) | |
KKeySequence (const KKeySequence &keySeq) | |
KKeySequence (const QString &keySeq) | |
~KKeySequence () | |
void | clear () |
bool | init (const QKeySequence &keySeq) |
bool | init (const KKey &key) |
bool | init (const KKeyNative &key) |
bool | init (const KKeySequence &keySeq) |
bool | init (const QString &key) |
KKeySequence & | operator= (const KKeySequence &seq) |
uint | count () const |
const KKey & | key (uint i) const |
bool | isTriggerOnRelease () const |
bool | setKey (uint i, const KKey &key) |
bool | isNull () const |
bool | startsWith (const KKeySequence &keySeq) const |
int | compare (const KKeySequence &keySeq) const |
bool | operator== (const KKeySequence &seq) const |
bool | operator!= (const KKeySequence &seq) const |
bool | operator< (const KKeySequence &seq) const |
QKeySequence | qt () const |
int | keyCodeQt () const |
QString | toString () const |
QString | toStringInternal () const |
Static Public Member Functions | |
static KKeySequence & | null () |
Protected Attributes | |
uchar | m_nKeys |
uchar | m_bTriggerOnRelease |
KKey | m_rgvar [MAX_KEYS] |
Friends | |
class | KKeyNative |
Detailed Description
A KKeySequence object holds a sequence of up to 4 keys.Ex: Ctrl+X,I
Definition at line 288 of file kshortcut.h.
Member Enumeration Documentation
|
Defines the maximum length of the key sequence.
Definition at line 292 of file kshortcut.h. |
Constructor & Destructor Documentation
|
Create a new null key sequence.
Definition at line 206 of file kshortcut.cpp. References clear(). |
|
Copies the given qt key sequence.
Definition at line 207 of file kshortcut.cpp. References init(). |
|
Create a new key sequence that only contains the given key.
Definition at line 208 of file kshortcut.cpp. References init(). |
|
Create a new key sequence that only contains the given key.
|
|
Copies the given key sequence.
Definition at line 209 of file kshortcut.cpp. References init(). |
|
Creates a new key sequence that contains the given key sequence. The description consists of comma-separated keys as required by KKey::KKey(const QString&).
Definition at line 210 of file kshortcut.cpp. References init(). |
Member Function Documentation
|
Clears the key sequence. The key sequence is null after calling this function.
Definition at line 216 of file kshortcut.cpp. References m_bTriggerOnRelease, and m_nKeys. Referenced by init(), KKeySequence(), and null(). |
|
Copies the given qt key sequence over this key sequence.
Definition at line 222 of file kshortcut.cpp. References clear(), QKeySequence::count(), KKey::init(), QKeySequence::isEmpty(), KKey::isNull(), m_bTriggerOnRelease, m_nKeys, and m_rgvar. Referenced by KShortcut::append(), KShortcut::init(), KKeySequence(), and KStdAccel::shortcutDefault4(). |
|
Initializes the key sequence to only contain the given key.
Definition at line 247 of file kshortcut.cpp. References clear(), KKey::init(), KKey::isNull(), m_bTriggerOnRelease, m_nKeys, and m_rgvar. |
|
Initializes the key sequence to only contain the given key.
|
|
Copies the given key sequence over this key sequence.
Definition at line 258 of file kshortcut.cpp. References endl(), KKey::isNull(), kdDebug(), m_bTriggerOnRelease, m_nKeys, and m_rgvar. |
|
Initializes this key sequence to contain the given key sequence. The description consists of comma-separated keys as required by KKey::KKey(const QString&).
Definition at line 273 of file kshortcut.cpp. References clear(), KKey::init(), m_bTriggerOnRelease, m_nKeys, m_rgvar, and QStringList::split(). |
|
Copy the given key sequence into this sequence.
Definition at line 387 of file kshortcut.h. |
|
Returns the number of key strokes of this sequence.
Definition at line 294 of file kshortcut.cpp. References m_nKeys. Referenced by KShortcut::contains(), KAccelBase::createKeyList(), KAccelBase::insertConnection(), keyCodeQt(), qt(), KStdAccel::shortcutDefault4(), KAccelBase::updateConnections(), and KShortcutMenu::updateShortcuts(). |
|
Return the
Definition at line 299 of file kshortcut.cpp. References m_nKeys, m_rgvar, and KKey::null(). Referenced by KShortcut::contains(), KAccelBase::createKeyList(), KAccelBase::insertConnection(), keyCodeQt(), qt(), and KShortcutMenu::updateShortcuts(). |
|
Sets the
You can not introduce gaps in a sequence, so you must use an
Definition at line 310 of file kshortcut.cpp. References KKey::init(), m_nKeys, and m_rgvar. |
|
Returns true if the key sequence is null (after clear() or empty constructor).
Definition at line 321 of file kshortcut.cpp. References m_nKeys. Referenced by KShortcut::append(), KShortcut::contains(), KStdAccel::findStdAccel(), KShortcutList::index(), null(), and KShortcut::remove(). |
|
Returns true if this key sequence begins with the given sequence.
Definition at line 326 of file kshortcut.cpp. References m_nKeys, and m_rgvar. Referenced by KAccelBase::createPopupMenu(). |
|
Compares this object with the given key sequence. Returns a negative number if the given KKeySequence is larger, 0 if they are equal and a positive number this KKeySequence is larger. Key sequences are compared by comparing the individual keys, starting from the beginning until an unequal key has been found. If a sequence contains more keys, it is considered larger.
Definition at line 339 of file kshortcut.cpp. References KKey::compare(), m_nKeys, and m_rgvar. Referenced by KShortcut::compare(). |
|
Compares the keys of both sequences.
Definition at line 456 of file kshortcut.h. |
|
Compares the keys of both sequences.
Definition at line 463 of file kshortcut.h. |
|
Compares the keys of both sequences.
Definition at line 470 of file kshortcut.h. |
|
Converts this key sequence to a QKeySequence.
Definition at line 352 of file kshortcut.cpp. References count(), key(), and KKeyNative. Referenced by KCheckAccelerators::KCheckAccelerators(), and KShortcut::operator QKeySequence(). |
|
Returns the qt key code of the first key.
Definition at line 368 of file kshortcut.cpp. References count(), key(), and KKeyNative. Referenced by KShortcut::keyCodeQt(). |
|
Returns the key sequence as a number of key presses as returned by KKey::toString(), separated by commas.
Definition at line 373 of file kshortcut.cpp. References m_nKeys, m_rgvar, and KKey::toString(). Referenced by KAccel::changeMenuAccel(), KShortcut::toString(), and KShortcutMenu::updateShortcuts(). |
|
Returns a null key sequence.
Definition at line 401 of file kshortcut.cpp. References clear(), and isNull(). Referenced by KShortcut::seq(). |
The documentation for this class was generated from the following files: