\section{KKey\-Sequence Class Reference}
\label{classKKeySequence}\index{KKeySequence@{KKeySequence}}
A KKey\-Sequence object holds a sequence of up to 4 keys.  


{\tt \#include $<$kshortcut.h$>$}

Collaboration diagram for KKey\-Sequence:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=60pt]{classKKeySequence__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum \{ {\bf MAX\_\-KEYS} =  4
 \}
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KKey\-Sequence} ()
\item 
{\bf KKey\-Sequence} (const {\bf QKey\-Sequence} \&key\-Seq)
\item 
{\bf KKey\-Sequence} (const {\bf KKey} \&key)
\item 
{\bf KKey\-Sequence} (const {\bf KKey\-Native} \&key)
\item 
{\bf KKey\-Sequence} (const {\bf KKey\-Sequence} \&key\-Seq)
\item 
{\bf KKey\-Sequence} (const {\bf QString} \&key\-Seq)
\item 
void {\bf clear} ()
\item 
bool {\bf init} (const {\bf QKey\-Sequence} \&key\-Seq)
\item 
bool {\bf init} (const {\bf KKey} \&key)
\item 
bool {\bf init} (const {\bf KKey\-Native} \&key)
\item 
bool {\bf init} (const {\bf KKey\-Sequence} \&key\-Seq)
\item 
bool {\bf init} (const {\bf QString} \&key)
\item 
{\bf KKey\-Sequence} \& {\bf operator=} (const {\bf KKey\-Sequence} \&seq)
\item 
uint {\bf count} () const 
\item 
const {\bf KKey} \& {\bf key} (uint i) const 
\item 
bool {\bf is\-Trigger\-On\-Release} () const \label{classKKeySequence_a16}

\item 
bool {\bf set\-Key} (uint i, const {\bf KKey} \&key)
\item 
bool {\bf is\-Null} () const 
\item 
bool {\bf starts\-With} (const {\bf KKey\-Sequence} \&key\-Seq) const 
\item 
int {\bf compare} (const {\bf KKey\-Sequence} \&key\-Seq) const 
\item 
bool {\bf operator==} (const {\bf KKey\-Sequence} \&seq) const 
\item 
bool {\bf operator!=} (const {\bf KKey\-Sequence} \&seq) const 
\item 
bool {\bf operator$<$} (const {\bf KKey\-Sequence} \&seq) const 
\item 
{\bf QKey\-Sequence} {\bf qt} () const 
\item 
int {\bf key\-Code\-Qt} () const 
\item 
{\bf QString} {\bf to\-String} () const 
\item 
{\bf QString} {\bf to\-String\-Internal} () const \label{classKKeySequence_a27}

\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
static {\bf KKey\-Sequence} \& {\bf null} ()
\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
uchar {\bf m\_\-n\-Keys}\label{classKKeySequence_p0}

\item 
uchar {\bf m\_\-b\-Trigger\-On\-Release}\label{classKKeySequence_p1}

\item 
{\bf KKey} {\bf m\_\-rgvar} [MAX\_\-KEYS]\label{classKKeySequence_p2}

\end{CompactItemize}
\subsection*{Friends}
\begin{CompactItemize}
\item 
class {\bf KKey\-Native}\label{classKKeySequence_n0}

\end{CompactItemize}


\subsection{Detailed Description}
A KKey\-Sequence object holds a sequence of up to 4 keys. 

Ex: Ctrl+X,I \begin{Desc}
\item[See also:]{\bf KKey}{\rm (p.\,\pageref{classKKey})} 

{\bf KShortcut}{\rm (p.\,\pageref{classKShortcut})} \end{Desc}




Definition at line 288 of file kshortcut.h.

\subsection{Member Enumeration Documentation}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}anonymous enum}\label{classKKeySequence_w1}


Defines the maximum length of the key sequence. 



Definition at line 292 of file kshortcut.h.

\subsection{Constructor \& Destructor Documentation}
\index{KKeySequence@{KKey\-Sequence}!KKeySequence@{KKeySequence}}
\index{KKeySequence@{KKeySequence}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KKey\-Sequence::KKey\-Sequence ()}\label{classKKeySequence_a0}


Create a new null key sequence. 

\begin{Desc}
\item[See also:]{\bf is\-Null()}{\rm (p.\,\pageref{classKKeySequence_a18})} 

{\bf null()}{\rm (p.\,\pageref{classKKeySequence_e0})} 

{\bf clear()}{\rm (p.\,\pageref{classKKeySequence_a7})}\end{Desc}


Definition at line 206 of file kshortcut.cpp.

References clear().\index{KKeySequence@{KKey\-Sequence}!KKeySequence@{KKeySequence}}
\index{KKeySequence@{KKeySequence}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KKey\-Sequence::KKey\-Sequence (const {\bf QKey\-Sequence} \& {\em key\-Seq})}\label{classKKeySequence_a1}


Copies the given qt key sequence. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key\-Seq}]the qt key sequence to copy\end{description}
\end{Desc}


Definition at line 207 of file kshortcut.cpp.

References init().\index{KKeySequence@{KKey\-Sequence}!KKeySequence@{KKeySequence}}
\index{KKeySequence@{KKeySequence}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KKey\-Sequence::KKey\-Sequence (const {\bf KKey} \& {\em key})}\label{classKKeySequence_a2}


Create a new key sequence that only contains the given key. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key}]the key to add\end{description}
\end{Desc}


Definition at line 208 of file kshortcut.cpp.

References init(), and key().\index{KKeySequence@{KKey\-Sequence}!KKeySequence@{KKeySequence}}
\index{KKeySequence@{KKeySequence}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KKey\-Sequence::KKey\-Sequence (const {\bf KKey\-Native} \& {\em key})}\label{classKKeySequence_a3}


Create a new key sequence that only contains the given key. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key}]the key to add\end{description}
\end{Desc}
\index{KKeySequence@{KKey\-Sequence}!KKeySequence@{KKeySequence}}
\index{KKeySequence@{KKeySequence}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KKey\-Sequence::KKey\-Sequence (const {\bf KKey\-Sequence} \& {\em key\-Seq})}\label{classKKeySequence_a4}


Copies the given key sequence. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key\-Seq}]the key sequence to copy\end{description}
\end{Desc}


Definition at line 209 of file kshortcut.cpp.

References init().\index{KKeySequence@{KKey\-Sequence}!KKeySequence@{KKeySequence}}
\index{KKeySequence@{KKeySequence}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KKey\-Sequence::KKey\-Sequence (const {\bf QString} \& {\em key\-Seq})}\label{classKKeySequence_a5}


Creates a new key sequence that contains the given key sequence. 

The description consists of comma-separated keys as required by {\bf KKey::KKey(const QString\&)}{\rm (p.\,\pageref{classKKey_a5})}. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key\-Seq}]the description of the key \end{description}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf KKey\-Server::Sym::init()}{\rm (p.\,\pageref{structKKeyServer_1_1Sym_a4})} 

{\bf KKey::KKey(const QString\&)}{\rm (p.\,\pageref{classKKey_a5})}\end{Desc}


Definition at line 210 of file kshortcut.cpp.

References init().

\subsection{Member Function Documentation}
\index{KKeySequence@{KKey\-Sequence}!clear@{clear}}
\index{clear@{clear}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KKey\-Sequence::clear ()}\label{classKKeySequence_a7}


Clears the key sequence. 

The key sequence is null after calling this function. \begin{Desc}
\item[See also:]{\bf is\-Null()}{\rm (p.\,\pageref{classKKeySequence_a18})}\end{Desc}


Definition at line 216 of file kshortcut.cpp.

Referenced by init(), KKey\-Sequence(), and null().\index{KKeySequence@{KKey\-Sequence}!init@{init}}
\index{init@{init}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KKey\-Sequence::init (const {\bf QKey\-Sequence} \& {\em key\-Seq})}\label{classKKeySequence_a8}


Copies the given qt key sequence over this key sequence. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key\-Seq}]the qt key sequence to copy \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise\end{Desc}


Definition at line 222 of file kshortcut.cpp.

References clear(), KKey::init(), and KKey::is\-Null().

Referenced by KShortcut::append(), KShortcut::init(), KKey\-Sequence(), and KStd\-Accel::shortcut\-Default4().\index{KKeySequence@{KKey\-Sequence}!init@{init}}
\index{init@{init}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KKey\-Sequence::init (const {\bf KKey} \& {\em key})}\label{classKKeySequence_a9}


Initializes the key sequence to only contain the given key. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key}]the key to set \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise\end{Desc}


Definition at line 247 of file kshortcut.cpp.

References clear(), KKey::init(), KKey::is\-Null(), and key().\index{KKeySequence@{KKey\-Sequence}!init@{init}}
\index{init@{init}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KKey\-Sequence::init (const {\bf KKey\-Native} \& {\em key})}\label{classKKeySequence_a10}


Initializes the key sequence to only contain the given key. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key}]the key to set \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise\end{Desc}
\index{KKeySequence@{KKey\-Sequence}!init@{init}}
\index{init@{init}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KKey\-Sequence::init (const {\bf KKey\-Sequence} \& {\em key\-Seq})}\label{classKKeySequence_a11}


Copies the given key sequence over this key sequence. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key\-Seq}]the key sequence to copy \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise\end{Desc}


Definition at line 258 of file kshortcut.cpp.

References endl().\index{KKeySequence@{KKey\-Sequence}!init@{init}}
\index{init@{init}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KKey\-Sequence::init (const {\bf QString} \& {\em key})}\label{classKKeySequence_a12}


Initializes this key sequence to contain the given key sequence. 

The description consists of comma-separated keys as required by {\bf KKey::KKey(const QString\&)}{\rm (p.\,\pageref{classKKey_a5})}. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key}]the description of the key \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise \end{Desc}
\begin{Desc}
\item[See also:]{\bf KKey\-Server::Sym::init()}{\rm (p.\,\pageref{structKKeyServer_1_1Sym_a4})} 

{\bf KKey::KKey(const QString\&)}{\rm (p.\,\pageref{classKKey_a5})}\end{Desc}


Definition at line 273 of file kshortcut.cpp.

References clear(), KKey::init(), and QString\-List::split().\index{KKeySequence@{KKey\-Sequence}!operator=@{operator=}}
\index{operator=@{operator=}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KKey\-Sequence}\& KKey\-Sequence::operator= (const {\bf KKey\-Sequence} \& {\em seq})\hspace{0.3cm}{\tt  [inline]}}\label{classKKeySequence_a13}


Copy the given key sequence into this sequence. 



Definition at line 387 of file kshortcut.h.\index{KKeySequence@{KKey\-Sequence}!count@{count}}
\index{count@{count}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}uint KKey\-Sequence::count () const}\label{classKKeySequence_a14}


Returns the number of key strokes of this sequence. 

\begin{Desc}
\item[Returns:]the number of key strokes \end{Desc}
\begin{Desc}
\item[See also:]MAX\_\-KEYS\end{Desc}


Definition at line 294 of file kshortcut.cpp.

Referenced by KShortcut::contains(), key\-Code\-Qt(), qt(), and KStd\-Accel::shortcut\-Default4().\index{KKeySequence@{KKey\-Sequence}!key@{key}}
\index{key@{key}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}const {\bf KKey} \& KKey\-Sequence::key (uint {\em i}) const}\label{classKKeySequence_a15}


Return the {\tt i'th} key of this sequence, or a null key if there are less then i keys. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em i}]the key to retrieve \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]the {\tt i'th} key, or {\bf KKey::null()}{\rm (p.\,\pageref{classKKey_e0})} if there are less than i keys \end{Desc}
\begin{Desc}
\item[See also:]MAX\_\-KEYS\end{Desc}


Definition at line 299 of file kshortcut.cpp.

References KKey::null().

Referenced by KShortcut::contains(), init(), key\-Code\-Qt(), KKey\-Sequence(), qt(), and set\-Key().\index{KKeySequence@{KKey\-Sequence}!setKey@{setKey}}
\index{setKey@{setKey}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KKey\-Sequence::set\-Key (uint {\em i}, const {\bf KKey} \& {\em key})}\label{classKKeySequence_a17}


Sets the {\tt i'th} key of the sequence. 

You can not introduce gaps in a sequence, so you must use an {\tt i} $<$= {\bf count()}{\rm (p.\,\pageref{classKKeySequence_a14})}. Also note that the maximum length of a key sequence is MAX\_\-KEYS. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em i}]the position of the new key ($<$= {\bf count()}{\rm (p.\,\pageref{classKKeySequence_a14})}, $<$= MAX\_\-KEYS) \item[{\em key}]the key to set \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if successful, false otherwise\end{Desc}


Definition at line 310 of file kshortcut.cpp.

References KKey::init(), and key().\index{KKeySequence@{KKey\-Sequence}!isNull@{isNull}}
\index{isNull@{isNull}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KKey\-Sequence::is\-Null () const}\label{classKKeySequence_a18}


Returns true if the key sequence is null (after {\bf clear()}{\rm (p.\,\pageref{classKKeySequence_a7})} or empty constructor). 

\begin{Desc}
\item[Returns:]true if the key sequence is null \end{Desc}
\begin{Desc}
\item[See also:]{\bf clear()}{\rm (p.\,\pageref{classKKeySequence_a7})} 

{\bf null()}{\rm (p.\,\pageref{classKKeySequence_e0})}\end{Desc}


Definition at line 321 of file kshortcut.cpp.

Referenced by KShortcut::append(), KShortcut::contains(), null(), and KShortcut::remove().\index{KKeySequence@{KKey\-Sequence}!startsWith@{startsWith}}
\index{startsWith@{startsWith}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KKey\-Sequence::starts\-With (const {\bf KKey\-Sequence} \& {\em key\-Seq}) const}\label{classKKeySequence_a19}


Returns true if this key sequence begins with the given sequence. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key\-Seq}]the key sequence to search \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]true if this key sequence begins with the given sequence\end{Desc}


Definition at line 326 of file kshortcut.cpp.\index{KKeySequence@{KKey\-Sequence}!compare@{compare}}
\index{compare@{compare}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KKey\-Sequence::compare (const {\bf KKey\-Sequence} \& {\em key\-Seq}) const}\label{classKKeySequence_a20}


Compares this object with the given key sequence. 

Returns a negative number if the given KKey\-Sequence is larger, 0 if they are equal and a positive number this KKey\-Sequence 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. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em key\-Seq}]the key sequence to compare to \end{description}
\end{Desc}
\begin{Desc}
\item[Returns:]a negative number if the given KKey\-Sequence is larger, 0 if they are equal and a positive number this KKey\-Sequence is larger \end{Desc}
\begin{Desc}
\item[See also:]KKey::sequence\end{Desc}


Definition at line 339 of file kshortcut.cpp.

References KKey::compare().

Referenced by KShortcut::compare().\index{KKeySequence@{KKey\-Sequence}!operator==@{operator==}}
\index{operator==@{operator==}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KKey\-Sequence::operator== (const {\bf KKey\-Sequence} \& {\em seq}) const\hspace{0.3cm}{\tt  [inline]}}\label{classKKeySequence_a21}


Compares the keys of both sequences. 

\begin{Desc}
\item[See also:]{\bf compare()}{\rm (p.\,\pageref{classKKeySequence_a20})}\end{Desc}


Definition at line 456 of file kshortcut.h.\index{KKeySequence@{KKey\-Sequence}!operator"!=@{operator"!=}}
\index{operator"!=@{operator"!=}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KKey\-Sequence::operator!= (const {\bf KKey\-Sequence} \& {\em seq}) const\hspace{0.3cm}{\tt  [inline]}}\label{classKKeySequence_a22}


Compares the keys of both sequences. 

\begin{Desc}
\item[See also:]{\bf compare()}{\rm (p.\,\pageref{classKKeySequence_a20})}\end{Desc}


Definition at line 463 of file kshortcut.h.\index{KKeySequence@{KKey\-Sequence}!operator<@{operator$<$}}
\index{operator<@{operator$<$}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KKey\-Sequence::operator$<$ (const {\bf KKey\-Sequence} \& {\em seq}) const\hspace{0.3cm}{\tt  [inline]}}\label{classKKeySequence_a23}


Compares the keys of both sequences. 

\begin{Desc}
\item[See also:]{\bf compare()}{\rm (p.\,\pageref{classKKeySequence_a20})}\end{Desc}


Definition at line 470 of file kshortcut.h.\index{KKeySequence@{KKey\-Sequence}!qt@{qt}}
\index{qt@{qt}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QKey\-Sequence} KKey\-Sequence::qt () const}\label{classKKeySequence_a24}


Converts this key sequence to a {\bf QKey\-Sequence}. 

\begin{Desc}
\item[Returns:]the {\bf QKey\-Sequence}\end{Desc}


Definition at line 352 of file kshortcut.cpp.

References count(), and key().

Referenced by KShortcut::operator QKey\-Sequence().\index{KKeySequence@{KKey\-Sequence}!keyCodeQt@{keyCodeQt}}
\index{keyCodeQt@{keyCodeQt}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KKey\-Sequence::key\-Code\-Qt () const}\label{classKKeySequence_a25}


Returns the qt key code of the first key. 

\begin{Desc}
\item[Returns:]the qt key code of the first key \end{Desc}
\begin{Desc}
\item[See also:]Qt::Key 

{\bf KKey::key\-Code\-Qt()}{\rm (p.\,\pageref{classKKey_a23})}\end{Desc}


Definition at line 368 of file kshortcut.cpp.

References count(), and key().

Referenced by KShortcut::key\-Code\-Qt().\index{KKeySequence@{KKey\-Sequence}!toString@{toString}}
\index{toString@{toString}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KKey\-Sequence::to\-String () const}\label{classKKeySequence_a26}


Returns the key sequence as a number of key presses as returned by {\bf KKey::to\-String()}{\rm (p.\,\pageref{classKKey_a24})}, separated by commas. 

\begin{Desc}
\item[Returns:]the string represenation of this key sequence \end{Desc}
\begin{Desc}
\item[See also:]{\bf KKey::to\-String()}{\rm (p.\,\pageref{classKKey_a24})}\end{Desc}


Definition at line 373 of file kshortcut.cpp.

References KKey::to\-String().

Referenced by KShortcut::to\-String().\index{KKeySequence@{KKey\-Sequence}!null@{null}}
\index{null@{null}!KKeySequence@{KKey\-Sequence}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KKey\-Sequence} \& KKey\-Sequence::null ()\hspace{0.3cm}{\tt  [static]}}\label{classKKeySequence_e0}


Returns a null key sequence. 

\begin{Desc}
\item[Returns:]the null key sequence \end{Desc}
\begin{Desc}
\item[See also:]{\bf is\-Null()}{\rm (p.\,\pageref{classKKeySequence_a18})} 

{\bf clear()}{\rm (p.\,\pageref{classKKeySequence_a7})}\end{Desc}


Definition at line 401 of file kshortcut.cpp.

References clear(), and is\-Null().

Referenced by KShortcut::seq().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kshortcut.h\item 
kshortcut.cpp\end{CompactItemize}
