KKeySequence Class Reference
A KKeySequence object holds a sequence of up to 4 keys. More...
#include <kshortcut.h>
Public Types | |
enum | { MAX_KEYS = 4 } |
Defines the maximum length of the key sequence. More... | |
Public Member Functions | |
KKeySequence () | |
Create a new null key sequence. | |
KKeySequence (const QKeySequence &keySeq) | |
Copies the given qt key sequence. | |
KKeySequence (const KKey &key) | |
Create a new key sequence that only contains the given key. | |
KKeySequence (const KKeyNative &key) | |
Create a new key sequence that only contains the given key. | |
KKeySequence (const KKeySequence &keySeq) | |
Copies the given key sequence. | |
KKeySequence (const QString &keySeq) | |
Creates a new key sequence that contains the given key sequence. | |
void | clear () |
Clears the key sequence. | |
bool | init (const QKeySequence &keySeq) |
Copies the given qt key sequence over this key sequence. | |
bool | init (const KKey &key) |
Initializes the key sequence to only contain the given key. | |
bool | init (const KKeyNative &key) |
Initializes the key sequence to only contain the given key. | |
bool | init (const KKeySequence &keySeq) |
Copies the given key sequence over this key sequence. | |
bool | init (const QString &key) |
Initializes this key sequence to contain the given key sequence. | |
KKeySequence & | operator= (const KKeySequence &seq) |
Copy the given key sequence into this sequence. | |
uint | count () const |
Returns the number of key strokes of this sequence. | |
const KKey & | key (uint i) const |
Return the i'th key of this sequence, or a null key if there are less then i keys. | |
bool | isTriggerOnRelease () const |
bool | setKey (uint i, const KKey &key) |
Sets the i'th key of the sequence. | |
void | setTriggerOnRelease (bool) |
bool | isNull () const |
Returns true if the key sequence is null (after clear() or empty constructor). | |
bool | startsWith (const KKeySequence &keySeq) const |
Returns true if this key sequence begins with the given sequence. | |
int | compare (const KKeySequence &keySeq) const |
Compares this object with the given key sequence. | |
bool | operator== (const KKeySequence &seq) const |
Compares the keys of both sequences. | |
bool | operator!= (const KKeySequence &seq) const |
Compares the keys of both sequences. | |
bool | operator< (const KKeySequence &seq) const |
Compares the keys of both sequences. | |
QKeySequence | qt () const |
Converts this key sequence to a QKeySequence. | |
int | keyCodeQt () const |
Returns the qt key code of the first key. | |
QString | toString () const |
Returns the key sequence as a number of key presses as returned by KKey::toString(), seperated by commas. | |
QString | toStringInternal () const |
Static Public Member Functions | |
KKeySequence & | null () |
Returns a null key sequence. | |
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
- See also:
- KKey
KShortcut
Definition at line 294 of file kshortcut.h.
Member Enumeration Documentation
|
Defines the maximum length of the key sequence.
Definition at line 298 of file kshortcut.h. |
Constructor & Destructor Documentation
|
Create a new null key sequence.
Definition at line 207 of file kshortcut.cpp. References clear(). |
|
Copies the given qt key sequence.
Definition at line 208 of file kshortcut.cpp. References init(). |
|
Create a new key sequence that only contains the given key.
Definition at line 209 of file kshortcut.cpp. References init(), and KStdAccel::key(). |
|
Create a new key sequence that only contains the given key.
|
|
Copies the given key sequence.
Definition at line 210 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 211 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 217 of file kshortcut.cpp. Referenced by init(), KKeySequence(), and null(). |
|
Copies the given qt key sequence over this key sequence.
Definition at line 223 of file kshortcut.cpp. References clear(), QKeySequence::count(), and QKeySequence::isEmpty(). Referenced by KKeySequence(), operator=(), and KStdAccel::shortcutDefault4(). |
|
Initializes the key sequence to only contain the given key.
Definition at line 248 of file kshortcut.cpp. References clear(), and KStdAccel::key(). |
|
Initializes the key sequence to only contain the given key.
|
|
Copies the given key sequence over this key sequence.
Definition at line 259 of file kshortcut.cpp. |
|
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 274 of file kshortcut.cpp. References clear(), and QStringList::split(). |
|
Copy the given key sequence into this sequence.
Definition at line 393 of file kshortcut.h. References init(). |
|
Returns the number of key strokes of this sequence.
Definition at line 295 of file kshortcut.cpp. Referenced by keyCodeQt(), qt(), and KStdAccel::shortcutDefault4(). |
|
Return the
Definition at line 300 of file kshortcut.cpp. Referenced by keyCodeQt(), and qt(). |
|
Sets the
You can not introduce gaps in a sequence, so you must use an
Definition at line 311 of file kshortcut.cpp. References KStdAccel::key(). |
|
Returns true if the key sequence is null (after clear() or empty constructor).
Definition at line 322 of file kshortcut.cpp. Referenced by KStdAccel::findStdAccel(), KShortcutList::index(), and null(). |
|
Returns true if this key sequence begins with the given sequence.
Definition at line 327 of file kshortcut.cpp. |
|
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 340 of file kshortcut.cpp. References m_nKeys, and m_rgvar. Referenced by operator!=(), operator<(), and operator==(). |
|
Compares the keys of both sequences.
Definition at line 467 of file kshortcut.h. References compare(). |
|
Compares the keys of both sequences.
Definition at line 474 of file kshortcut.h. References compare(). |
|
Compares the keys of both sequences.
Definition at line 481 of file kshortcut.h. References compare(). |
|
Converts this key sequence to a QKeySequence.
Definition at line 353 of file kshortcut.cpp. |
|
Returns the qt key code of the first key.
Definition at line 369 of file kshortcut.cpp. |
|
Returns the key sequence as a number of key presses as returned by KKey::toString(), seperated by commas.
Definition at line 374 of file kshortcut.cpp. |
|
Returns a null key sequence.
Definition at line 402 of file kshortcut.cpp. |
The documentation for this class was generated from the following files: