.TH "KKey" kde3 "11 Jun 2005" "Version Version 3.4.1" "kdecore Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KKey \- A KKey object represents a single key with possible modifiers (Shift, Ctrl, Alt, Win).  

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

.in +1c
.ti -1c
.RI "enum { \fBMOD_FLAG_COUNT\fP =  4 }"
.br
.ti -1c
.RI "enum { \fBQtWIN\fP =  (Qt::META) }"
.br
.ti -1c
.RI "enum \fBModFlag\fP { \fBSHIFT\fP =  0x01, \fBCTRL\fP =  0x02, \fBALT\fP =  0x04, \fBWIN\fP =  0x08 }"
.br
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKKey\fP ()"
.br
.ti -1c
.RI "\fBKKey\fP (int keyQt)"
.br
.ti -1c
.RI "\fBKKey\fP (const \fBQKeySequence\fP &keySeq)"
.br
.ti -1c
.RI "\fBKKey\fP (const \fBQKeyEvent\fP *keyEvent)"
.br
.ti -1c
.RI "\fBKKey\fP (const \fBKKey\fP &key)"
.br
.ti -1c
.RI "\fBKKey\fP (const \fBQString\fP &key)"
.br
.ti -1c
.RI "\fBKKey\fP (uint key, uint mod)"
.br
.ti -1c
.RI "void \fBclear\fP ()"
.br
.ti -1c
.RI "bool \fBinit\fP (int keyQt)"
.br
.ti -1c
.RI "bool \fBinit\fP (const \fBQKeySequence\fP &keySeq)"
.br
.ti -1c
.RI "bool \fBinit\fP (const \fBQKeyEvent\fP *keyEvent)"
.br
.ti -1c
.RI "bool \fBinit\fP (const \fBKKey\fP &key)"
.br
.ti -1c
.RI "bool \fBinit\fP (const \fBQString\fP &key)"
.br
.ti -1c
.RI "bool \fBinit\fP (uint key, uint mod)"
.br
.ti -1c
.RI "\fBKKey\fP & \fBoperator=\fP (const \fBKKey\fP &key)"
.br
.ti -1c
.RI "bool \fBisNull\fP () const "
.br
.ti -1c
.RI "uint \fBsym\fP () const "
.br
.ti -1c
.RI "uint \fBmodFlags\fP () const "
.br
.ti -1c
.RI "int \fBcompare\fP (const \fBKKey\fP &key) const "
.br
.ti -1c
.RI "bool \fBoperator==\fP (const \fBKKey\fP &key) const "
.br
.ti -1c
.RI "bool \fBoperator!=\fP (const \fBKKey\fP &key) const "
.br
.ti -1c
.RI "bool \fBoperator<\fP (const \fBKKey\fP &key) const "
.br
.ti -1c
.RI "int \fBkeyCodeQt\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBtoString\fP () const "
.br
.ti -1c
.RI "\fBQString\fP \fBtoStringInternal\fP () const "
.br
.ti -1c
.RI "void \fBsimplify\fP ()"
.br
.in -1c
.SS "Static Public Member Functions"

.in +1c
.ti -1c
.RI "static \fBKKey\fP & \fBnull\fP ()"
.br
.ti -1c
.RI "static \fBQString\fP \fBmodFlagLabel\fP (\fBModFlag\fP f)"
.br
.in -1c
.SS "Friends"

.in +1c
.ti -1c
.RI "class \fBKKeyNative\fP"
.br
.in -1c
.SH "Detailed Description"
.PP 
A KKey object represents a single key with possible modifiers (Shift, Ctrl, Alt, Win). 

It can represent both keys which are understood by \fBQt\fP as well as those which are additionally supported by the underlying system (e.g. X11). 
.PP
\fBSee also:\fP
.RS 4
\fBKKeyNative\fP 
.PP
\fBKKeySequence\fP 
.PP
\fBKShortcut\fP 
.RE
.PP

.PP
Definition at line 40 of file kshortcut.h.
.SH "Member Enumeration Documentation"
.PP 
.SS "anonymous enum"
.PP
The number of flags. 
.PP
\fBSee also:\fP
.RS 4
\fBModFlag\fP
.RE
.PP

.PP
Definition at line 47 of file kshortcut.h.
.SS "enum \fBKKey::ModFlag\fP"
.PP
Flags to represent the modifiers. 
.PP
You can combine modifiers by ORing them.
.PP
Definition at line 53 of file kshortcut.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KKey::KKey ()"
.PP
Creates a new null KKey. 
.PP
\fBSee also:\fP
.RS 4
\fBclear()\fP 
.PP
\fBisNull()\fP 
.PP
\fBnull()\fP
.RE
.PP

.PP
Definition at line 42 of file kshortcut.cpp.
.PP
References clear().
.SS "KKey::KKey (int keyQt)"
.PP
Creates a new key for the given \fBQt\fP key code. 
.PP
\fBParameters:\fP
.RS 4
\fIkeyQt\fP the qt keycode 
.RE
.PP
\fBSee also:\fP
.RS 4
Qt::Key
.RE
.PP

.PP
Definition at line 44 of file kshortcut.cpp.
.PP
References init().
.SS "KKey::KKey (const \fBQKeySequence\fP & keySeq)"
.PP
Creates a new key from the first key code of the given key sequence. 
.PP
\fBParameters:\fP
.RS 4
\fIkeySeq\fP the key sequence that contains the key
.RE
.PP

.PP
Definition at line 45 of file kshortcut.cpp.
.PP
References init().
.SS "KKey::KKey (const \fBQKeyEvent\fP * keyEvent)"
.PP
Extracts the key from the given key event. 
.PP
\fBParameters:\fP
.RS 4
\fIkeyEvent\fP the key event to get the key from
.RE
.PP

.PP
Definition at line 46 of file kshortcut.cpp.
.PP
References init().
.SS "KKey::KKey (const \fBKKey\fP & key)"
.PP
Copy constructor. 
.PP

.PP
Definition at line 47 of file kshortcut.cpp.
.PP
References init().
.SS "KKey::KKey (const \fBQString\fP & key)"
.PP
Creates a new key from the given description. 
.PP
The form of the description is '[modifier+[modifier+]]+key', for example 'e', 'CTRL+q' or 'CTRL+ALT+DEL'. Allowed modifiers are 'SHIFT', 'CTRL', 'ALT', 'WIN' and 'META'. 'WIN' and 'META' are equivalent. Modifiers are not case-sensitive. 
.PP
\fBParameters:\fP
.RS 4
\fIkey\fP the description of the key 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBKKeyServer::Sym::init()\fP
.RE
.PP

.PP
Definition at line 48 of file kshortcut.cpp.
.PP
References init().
.SH "Member Function Documentation"
.PP 
.SS "void KKey::clear ()"
.PP
Clears the key. 
.PP
The key is null after calling this function. 
.PP
\fBSee also:\fP
.RS 4
\fBisNull()\fP
.RE
.PP

.PP
Definition at line 54 of file kshortcut.cpp.
.PP
Referenced by init(), KKey(), and null().
.SS "bool KKey::init (int keyQt)"
.PP
Initializes the key with the given \fBQt\fP key code. 
.PP
\fBParameters:\fP
.RS 4
\fIkeyQt\fP the qt keycode 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise 
.RE
.PP
\fBSee also:\fP
.RS 4
Qt::Key
.RE
.PP

.PP
Definition at line 67 of file kshortcut.cpp.
.PP
References KKeyServer::keyQtToMod(), and KKeyServer::keyQtToSym().
.PP
Referenced by KKeySequence::init(), init(), KKey(), and KKeySequence::setKey().
.SS "bool KKey::init (const \fBQKeySequence\fP & keySeq)"
.PP
Initializes the key with the first key code of the given key sequence. 
.PP
\fBParameters:\fP
.RS 4
\fIkeySeq\fP the key sequence that contains the key 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise
.RE
.PP

.PP
Definition at line 82 of file kshortcut.cpp.
.PP
References init().
.SS "bool KKey::init (const \fBQKeyEvent\fP * keyEvent)"
.PP
Initializes the key by extracting the code from the given key event. 
.PP
\fBParameters:\fP
.RS 4
\fIkeyEvent\fP the key event to get the key from 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise
.RE
.PP

.PP
Definition at line 88 of file kshortcut.cpp.
.PP
References init().
.SS "bool KKey::init (const \fBKKey\fP & key)"
.PP
Copies the given key. 
.PP
\fBParameters:\fP
.RS 4
\fIkey\fP the key to copy 
.RE
.PP
\fBReturns:\fP
.RS 4
true if successful, false otherwise
.RE
.PP

.PP
Definition at line 98 of file kshortcut.cpp.
.SS "bool KKey::init (const \fBQString\fP & key)"
.PP
Initializes the key with the given description. 
.PP
The form of the description is '[modifier+[modifier+]]+key', for example 'e', 'CTRL+q' or 'CTRL+ALT+DEL'. Allowed modifiers are 'SHIFT', 'CTRL', 'ALT', 'WIN' and 'META'. 'WIN' and 'META' are equivalent. Modifiers are not case-sensitive. 
.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
.RE
.PP

.PP
Definition at line 105 of file kshortcut.cpp.
.PP
References clear(), endl(), QString::endsWith(), QString::left(), QString::length(), KKeyServer::Sym::m_sym, QString::mid(), QString::number(), QStringList::split(), and QString::startsWith().
.SS "\fBKKey\fP& KKey::operator= (const \fBKKey\fP & key)\fC [inline]\fP"
.PP
Copies the key. 
.PP

.PP
Definition at line 162 of file kshortcut.h.
.SS "bool KKey::isNull () const"
.PP
Returns true if the key is null (after \fBclear()\fP or empty constructor). 
.PP
\fBReturns:\fP
.RS 4
true if the key is null 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBclear()\fP 
.PP
\fBnull()\fP
.RE
.PP

.PP
Definition at line 144 of file kshortcut.cpp.
.PP
Referenced by KKeySequence::init(), and null().
.SS "int KKey::compare (const \fBKKey\fP & key) const"
.PP
Compares this key with the given KKey object. 
.PP
Returns a negative number if the given KKey is larger, 0 if they are equal and a positive number this KKey is larger. The returned value is the difference between the symbol or, if the symbols are equal, the difference between the encoded modifiers. 
.PP
\fBParameters:\fP
.RS 4
\fIkey\fP the key to compare with this key 
.RE
.PP
\fBReturns:\fP
.RS 4
a negative number if the given KKey is larger, 0 if they are equal and a positive number this KKey is larger
.RE
.PP

.PP
Definition at line 148 of file kshortcut.cpp.
.PP
Referenced by KKeySequence::compare().
.SS "bool KKey::operator== (const \fBKKey\fP & key) const\fC [inline]\fP"
.PP
Compares the symbol and modifiers of both keys. 
.PP
\fBSee also:\fP
.RS 4
\fBcompare()\fP
.RE
.PP

.PP
Definition at line 201 of file kshortcut.h.
.SS "bool KKey::operator!= (const \fBKKey\fP & key) const\fC [inline]\fP"
.PP
Compares the symbol and modifiers of both keys. 
.PP
\fBSee also:\fP
.RS 4
\fBcompare()\fP
.RE
.PP

.PP
Definition at line 207 of file kshortcut.h.
.SS "bool KKey::operator< (const \fBKKey\fP & key) const\fC [inline]\fP"
.PP
Compares the symbol and modifiers of both keys. 
.PP
\fBSee also:\fP
.RS 4
\fBcompare()\fP
.RE
.PP

.PP
Definition at line 213 of file kshortcut.h.
.SS "int KKey::keyCodeQt () const"
.PP
Returns the qt key code. 
.PP
\fBReturns:\fP
.RS 4
the qt key code or 0 if there is no key set. 
.RE
.PP
\fBSee also:\fP
.RS 4
Qt::Key
.RE
.PP

.PP
Definition at line 157 of file kshortcut.cpp.
.PP
Referenced by KKeyServer::Key::init().
.SS "\fBQString\fP KKey::toString () const"
.PP
Returns a human-readable representation of the key in the form 'modifier+key'. 
.PP
Note that the representation is localised, use \fBtoStringInternal()\fP for cases like saving to configuration files. 
.PP
\fBReturns:\fP
.RS 4
the string representation of the key 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBtoStringInternal()\fP
.RE
.PP

.PP
Definition at line 162 of file kshortcut.cpp.
.PP
References QString::isEmpty(), and KKeyServer::modToStringUser().
.PP
Referenced by KKeySequence::toString().
.SS "\fBQString\fP KKey::toStringInternal () const"
.PP
Returns an untranslated text representation of the key in the form 'modifier+key', suitable e.g. 
.PP
for saving in configuration files.
.PP
Definition at line 174 of file kshortcut.cpp.
.PP
References QString::isEmpty().
.SS "\fBKKey\fP & KKey::null ()\fC [static]\fP"
.PP
Returns a null key. 
.PP
\fBReturns:\fP
.RS 4
the null key 
.RE
.PP
\fBSee also:\fP
.RS 4
\fBisNull()\fP 
.PP
\fBclear()\fP
.RE
.PP

.PP
Definition at line 188 of file kshortcut.cpp.
.PP
References clear(), and isNull().
.PP
Referenced by KKeySequence::key().
.SS "\fBQString\fP KKey::modFlagLabel (\fBModFlag\fP f)\fC [static]\fP"
.PP
Returns a user-readable representation of the given modifiers. 
.PP
\fBParameters:\fP
.RS 4
\fIf\fP the modifiers to convert 
.RE
.PP
\fBReturns:\fP
.RS 4
the string representation of the modifiers
.RE
.PP

.PP
Definition at line 197 of file kshortcut.cpp.
.PP
References KKeyServer::modToStringUser().

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