.TH "KKeySequence" 3 "28 Jan 2004" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KKeySequence \- A KKeySequence object holds a sequence of up to 4 keys.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <kshortcut.h>\fP
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum { \fBMAX_KEYS\fP =  4 }"
.br
.RI "\fIDefines the maximum length of the key sequence. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKKeySequence\fP ()"
.br
.RI "\fICreate a new null key sequence. \fP"
.ti -1c
.RI "\fBKKeySequence\fP (const  \fBQKeySequence\fP &keySeq)"
.br
.RI "\fICopies the given qt key sequence. \fP"
.ti -1c
.RI "\fBKKeySequence\fP (const  KKey &key)"
.br
.RI "\fICreate a new key sequence that only contains the given key. \fP"
.ti -1c
.RI "\fBKKeySequence\fP (const  \fBKKeyNative\fP &key)"
.br
.RI "\fICreate a new key sequence that only contains the given key. \fP"
.ti -1c
.RI "\fBKKeySequence\fP (const  \fBKKeySequence\fP &keySeq)"
.br
.RI "\fICopies the given key sequence. \fP"
.ti -1c
.RI "\fBKKeySequence\fP (const  \fBQString\fP &keySeq)"
.br
.RI "\fICreates a new key sequence that contains the given key sequence. \fP"
.ti -1c
.RI "void \fBclear\fP ()"
.br
.RI "\fIClears the key sequence. \fP"
.ti -1c
.RI "bool \fBinit\fP (const  \fBQKeySequence\fP &keySeq)"
.br
.RI "\fICopies the given qt key sequence over this key sequence. \fP"
.ti -1c
.RI "bool \fBinit\fP (const  KKey &key)"
.br
.RI "\fIInitializes the key sequence to only contain the given key. \fP"
.ti -1c
.RI "bool \fBinit\fP (const  \fBKKeyNative\fP &key)"
.br
.RI "\fIInitializes the key sequence to only contain the given key. \fP"
.ti -1c
.RI "bool \fBinit\fP (const  \fBKKeySequence\fP &keySeq)"
.br
.RI "\fICopies the given key sequence over this key sequence. \fP"
.ti -1c
.RI "bool \fBinit\fP (const  \fBQString\fP &key)"
.br
.RI "\fIInitializes this key sequence to contain the given key sequence. \fP"
.ti -1c
.RI "\fBKKeySequence\fP & \fBoperator=\fP (const  \fBKKeySequence\fP &seq)"
.br
.RI "\fICopy the given key sequence into this sequence. \fP"
.ti -1c
.RI "uint \fBcount\fP () const "
.br
.RI "\fIReturns the number of key strokes of this sequence. \fP"
.ti -1c
.RI "const  KKey & \fBkey\fP (uint i) const "
.br
.RI "\fIReturn the \fCi'th\fP key of this sequence, or a null key if there are less then i keys. \fP"
.ti -1c
.RI "bool \fBisTriggerOnRelease\fP () const "
.br
.ti -1c
.RI "bool \fBsetKey\fP (uint i, const  KKey &key)"
.br
.RI "\fISets the \fCi'th\fP key of the sequence. \fP"
.ti -1c
.RI "void \fBsetTriggerOnRelease\fP (bool)"
.br
.ti -1c
.RI "bool \fBisNull\fP () const "
.br
.RI "\fIReturns true if the key sequence is null (after \fBclear\fP() or empty constructor). \fP"
.ti -1c
.RI "bool \fBstartsWith\fP (const  \fBKKeySequence\fP &keySeq) const "
.br
.RI "\fIReturns true if this key sequence begins with the given sequence. \fP"
.ti -1c
.RI "int \fBcompare\fP (const  \fBKKeySequence\fP &keySeq) const "
.br
.RI "\fICompares this object with the given key sequence. \fP"
.ti -1c
.RI "bool \fBoperator==\fP (const  \fBKKeySequence\fP &seq) const "
.br
.RI "\fICompares the keys of both sequences. \fP"
.ti -1c
.RI "bool \fBoperator!=\fP (const  \fBKKeySequence\fP &seq) const "
.br
.RI "\fICompares the keys of both sequences. \fP"
.ti -1c
.RI "bool \fBoperator<\fP (const  \fBKKeySequence\fP &seq) const "
.br
.RI "\fICompares the keys of both sequences. \fP"
.ti -1c
.RI "\fBQKeySequence\fP \fBqt\fP () const "
.br
.RI "\fIConverts this key sequence to a \fBQKeySequence\fP. \fP"
.ti -1c
.RI "int \fBkeyCodeQt\fP () const "
.br
.RI "\fIReturns the qt key code of the first key. \fP"
.ti -1c
.RI "\fBQString\fP \fBtoString\fP () const "
.br
.RI "\fIReturns the key sequence as a number of key presses as returned by \fBKKey::toString\fP(), seperated by commas. \fP"
.ti -1c
.RI "\fBQString\fP \fBtoStringInternal\fP () const "
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKKeySequence\fP & \fBnull\fP ()"
.br
.RI "\fIReturns a null key sequence. \fP"
.in -1c
.SS "Protected Attributes"

.in +1c
.ti -1c
.RI "uchar \fBm_nKeys\fP"
.br
.ti -1c
.RI "uchar \fBm_bTriggerOnRelease\fP"
.br
.ti -1c
.RI "KKey \fBm_rgvar\fP [MAX_KEYS]"
.br
.in -1c
.SS "Friends"

.in +1c
.ti -1c
.RI "class \fBKKeyNative\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
A KKeySequence object holds a sequence of up to 4 keys. 

Ex: Ctrl+X,I 
.PP
\fBSee also:\fP
.RS 4
KKey 
.PP
KShortcut 
.RE
.PP

.PP
Definition at line 294 of file kshortcut.h.
.SH "Member Enumeration Documentation"
.PP 
.SS "anonymous enum"
.PP
Defines the maximum length of the key sequence. Definition at line 298 of file kshortcut.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KKeySequence::KKeySequence ()"
.PP
Create a new null key sequence. \fBSee also:\fP
.RS 4
\fBisNull()\fP 
.PP
\fBnull()\fP 
.PP
\fBclear()\fP
.RE
.PP
Definition at line 207 of file kshortcut.cpp.
.PP
References clear().
.SS "KKeySequence::KKeySequence (const \fBQKeySequence\fP & keySeq)"
.PP
Copies the given qt key sequence. \fBParameters:\fP
.RS 4
\fIkeySeq\fP the qt key sequence to copy
.RE
.PP
Definition at line 208 of file kshortcut.cpp.
.PP
References init().
.SS "KKeySequence::KKeySequence (const KKey & key)"
.PP
Create a new key sequence that only contains the given key. \fBParameters:\fP
.RS 4
\fIkey\fP the key to add
.RE
.PP
Definition at line 209 of file kshortcut.cpp.
.PP
References init(), and KStdAccel::key().
.SS "KKeySequence::KKeySequence (const \fBKKeyNative\fP & key)"
.PP
Create a new key sequence that only contains the given key. \fBParameters:\fP
.RS 4
\fIkey\fP the key to add
.RE
.PP

.SS "KKeySequence::KKeySequence (const \fBKKeySequence\fP & keySeq)"
.PP
Copies the given key sequence. \fBParameters:\fP
.RS 4
\fIkeySeq\fP the key sequence to copy
.RE
.PP
Definition at line 210 of file kshortcut.cpp.
.PP
References init().
.SS "KKeySequence::KKeySequence (const \fBQString\fP & keySeq)"
.PP
Creates a new key sequence that contains the given key sequence. The description consists of comma-separated keys as required by \fBKKey::KKey\fP(const \fBQString\fP&). 
.PP
\fBParameters:\fP
.RS 4
\fIkeySeq\fP the description of the key 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBKKeyServer::Sym::init()\fP 
.PP
KKey::KKey(const QString&)
.RE
.PP
Definition at line 211 of file kshortcut.cpp.
.PP
References init().
.SH "Member Function Documentation"
.PP 
.SS "void KKeySequence::clear ()"
.PP
Clears the key sequence. The key sequence is null after calling this function. 
.PP
\fBSee also:\fP
.RS 4
\fBisNull()\fP
.RE
.PP
Definition at line 217 of file kshortcut.cpp.
.PP
Referenced by init(), KKeySequence(), and null().
.SS "bool KKeySequence::init (const \fBQKeySequence\fP & keySeq)"
.PP
Copies the given qt key sequence over this key sequence. \fBParameters:\fP
.RS 4
\fIkeySeq\fP the qt key sequence to copy 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise
.RE
.PP
Definition at line 223 of file kshortcut.cpp.
.PP
References clear(), QKeySequence::count(), and QKeySequence::isEmpty().
.PP
Referenced by KKeySequence(), operator=(), and KStdAccel::shortcutDefault4().
.SS "bool KKeySequence::init (const KKey & key)"
.PP
Initializes the key sequence to only contain the given key. \fBParameters:\fP
.RS 4
\fIkey\fP the key to set 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise
.RE
.PP
Definition at line 248 of file kshortcut.cpp.
.PP
References clear(), and KStdAccel::key().
.SS "bool KKeySequence::init (const \fBKKeyNative\fP & key)"
.PP
Initializes the key sequence to only contain the given key. \fBParameters:\fP
.RS 4
\fIkey\fP the key to set 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise
.RE
.PP

.SS "bool KKeySequence::init (const \fBKKeySequence\fP & keySeq)"
.PP
Copies the given key sequence over this key sequence. \fBParameters:\fP
.RS 4
\fIkeySeq\fP the key sequence to copy 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise
.RE
.PP
Definition at line 259 of file kshortcut.cpp.
.PP
References m_nKeys, and m_rgvar.
.SS "bool KKeySequence::init (const \fBQString\fP & key)"
.PP
Initializes this key sequence to contain the given key sequence. The description consists of comma-separated keys as required by \fBKKey::KKey\fP(const \fBQString\fP&). 
.PP
\fBParameters:\fP
.RS 4
\fIkey\fP the description of the key 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBKKeyServer::Sym::init()\fP 
.PP
KKey::KKey(const QString&)
.RE
.PP
Definition at line 274 of file kshortcut.cpp.
.PP
References clear(), and QStringList::split().
.SS "\fBKKeySequence\fP& KKeySequence::operator= (const \fBKKeySequence\fP & seq)\fC [inline]\fP"
.PP
Copy the given key sequence into this sequence. Definition at line 393 of file kshortcut.h.
.PP
References init().
.SS "uint KKeySequence::count () const"
.PP
Returns the number of key strokes of this sequence. \fBReturns:\fP
.RS 4
the number of key strokes 
.RE
.PP
\fBSee also:\fP
.RS 4
MAX_KEYS
.RE
.PP
Definition at line 295 of file kshortcut.cpp.
.PP
Referenced by keyCodeQt(), qt(), and KStdAccel::shortcutDefault4().
.SS "const  KKey & KKeySequence::key (uint i) const"
.PP
Return the \fCi'th\fP key of this sequence, or a null key if there are less then i keys. \fBParameters:\fP
.RS 4
\fIi\fP the key to retrieve 
.RE
.PP
\fBReturns:\fP
.RS 4
the \fCi'th\fP key, or \fBKKey::null\fP() if there are less than i keys 
.RE
.PP
\fBSee also:\fP
.RS 4
MAX_KEYS
.RE
.PP
Definition at line 300 of file kshortcut.cpp.
.PP
Referenced by keyCodeQt(), and qt().
.SS "bool KKeySequence::setKey (uint i, const KKey & key)"
.PP
Sets the \fCi'th\fP key of the sequence. You can not introduce gaps in a sequence, so you must use an \fCi\fP <= \fBcount\fP(). Also note that the maximum length of a key sequence is \fBMAX_KEYS\fP. 
.PP
\fBParameters:\fP
.RS 4
\fIi\fP the position of the new key (<= \fBcount\fP(), <= \fBMAX_KEYS\fP) 
.br
\fIkey\fP the key to set 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise
.RE
.PP
Definition at line 311 of file kshortcut.cpp.
.PP
References KStdAccel::key().
.SS "bool KKeySequence::isNull () const"
.PP
Returns true if the key sequence is null (after \fBclear\fP() or empty constructor). \fBReturns:\fP
.RS 4
true if the key sequence is null 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBclear()\fP 
.PP
\fBnull()\fP
.RE
.PP
Definition at line 322 of file kshortcut.cpp.
.PP
Referenced by KStdAccel::findStdAccel(), KShortcutList::index(), and null().
.SS "bool KKeySequence::startsWith (const \fBKKeySequence\fP & keySeq) const"
.PP
Returns true if this key sequence begins with the given sequence. \fBParameters:\fP
.RS 4
\fIkeySeq\fP the key sequence to search 
.RE
.PP
\fBReturns:\fP
.RS 4
true if this key sequence begins with the given sequence
.RE
.PP
Definition at line 327 of file kshortcut.cpp.
.PP
References m_nKeys, and m_rgvar.
.SS "int KKeySequence::compare (const \fBKKeySequence\fP & keySeq) const"
.PP
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. 
.PP
\fBParameters:\fP
.RS 4
\fIkeySeq\fP the key sequence to compare to 
.RE
.PP
\fBReturns:\fP
.RS 4
a negative number if the given KKeySequence is larger, 0 if they are equal and a positive number this KKeySequence is larger 
.RE
.PP
\fBSee also:\fP
.RS 4
KKey::sequence
.RE
.PP
Definition at line 340 of file kshortcut.cpp.
.PP
References m_nKeys, and m_rgvar.
.PP
Referenced by operator!=(), operator<(), and operator==().
.SS "bool KKeySequence::operator== (const \fBKKeySequence\fP & seq) const\fC [inline]\fP"
.PP
Compares the keys of both sequences. \fBSee also:\fP
.RS 4
\fBcompare()\fP
.RE
.PP
Definition at line 467 of file kshortcut.h.
.PP
References compare().
.SS "bool KKeySequence::operator!= (const \fBKKeySequence\fP & seq) const\fC [inline]\fP"
.PP
Compares the keys of both sequences. \fBSee also:\fP
.RS 4
\fBcompare()\fP
.RE
.PP
Definition at line 474 of file kshortcut.h.
.PP
References compare().
.SS "bool KKeySequence::operator< (const \fBKKeySequence\fP & seq) const\fC [inline]\fP"
.PP
Compares the keys of both sequences. \fBSee also:\fP
.RS 4
\fBcompare()\fP
.RE
.PP
Definition at line 481 of file kshortcut.h.
.PP
References compare().
.SS "\fBQKeySequence\fP KKeySequence::qt () const"
.PP
Converts this key sequence to a \fBQKeySequence\fP. \fBReturns:\fP
.RS 4
the \fBQKeySequence\fP
.RE
.PP
Definition at line 353 of file kshortcut.cpp.
.PP
References count(), and key().
.SS "int KKeySequence::keyCodeQt () const"
.PP
Returns the qt key code of the first key. \fBReturns:\fP
.RS 4
the qt key code of the first key 
.RE
.PP
\fBSee also:\fP
.RS 4
Qt::Key 
.PP
KKey::keyCodeQt()
.RE
.PP
Definition at line 369 of file kshortcut.cpp.
.PP
References count(), and key().
.SS "\fBQString\fP KKeySequence::toString () const"
.PP
Returns the key sequence as a number of key presses as returned by \fBKKey::toString\fP(), seperated by commas. \fBReturns:\fP
.RS 4
the string represenation of this key sequence 
.RE
.PP
\fBSee also:\fP
.RS 4
KKey::toString()
.RE
.PP
Definition at line 374 of file kshortcut.cpp.
.SS "\fBKKeySequence\fP & KKeySequence::null ()\fC [static]\fP"
.PP
Returns a null key sequence. \fBReturns:\fP
.RS 4
the null key sequence 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBisNull()\fP 
.PP
\fBclear()\fP
.RE
.PP
Definition at line 402 of file kshortcut.cpp.
.PP
References clear(), and isNull().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdecore Library from the source code.
