• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
KKeySequence Class Reference

#include <tdeshortcut.h>

Public Types

enum  { MAX_KEYS = 4 }
 

Public Member Functions

 KKeySequence ()
 
 KKeySequence (const TQKeySequence &keySeq)
 
 KKeySequence (const KKey &key)
 
 KKeySequence (const KKeyNative &key)
 
 KKeySequence (const KKeySequence &keySeq)
 
 KKeySequence (const TQString &keySeq)
 
void clear ()
 
bool init (const TQKeySequence &keySeq)
 
bool init (const KKey &key)
 
bool init (const KKeyNative &key)
 
bool init (const KKeySequence &keySeq)
 
bool init (const TQString &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
 
TQKeySequence qt () const
 
int keyCodeQt () const
 
TQString toString () const
 
TQString 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

See also
KKey
TDEShortcut

Definition at line 288 of file tdeshortcut.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

Defines the maximum length of the key sequence.

Definition at line 292 of file tdeshortcut.h.

Constructor & Destructor Documentation

◆ KKeySequence() [1/6]

KKeySequence::KKeySequence ( )

Create a new null key sequence.

See also
isNull()
null()
clear()

Definition at line 211 of file tdeshortcut.cpp.

◆ KKeySequence() [2/6]

KKeySequence::KKeySequence ( const TQKeySequence &  keySeq)

Copies the given qt key sequence.

Parameters
keySeqthe qt key sequence to copy

Definition at line 212 of file tdeshortcut.cpp.

◆ KKeySequence() [3/6]

KKeySequence::KKeySequence ( const KKey &  key)

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

Parameters
keythe key to add

Definition at line 213 of file tdeshortcut.cpp.

◆ KKeySequence() [4/6]

KKeySequence::KKeySequence ( const KKeyNative &  key)

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

Parameters
keythe key to add

◆ KKeySequence() [5/6]

KKeySequence::KKeySequence ( const KKeySequence &  keySeq)

Copies the given key sequence.

Parameters
keySeqthe key sequence to copy

Definition at line 214 of file tdeshortcut.cpp.

◆ KKeySequence() [6/6]

KKeySequence::KKeySequence ( const TQString &  keySeq)

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

The description consists of comma-separated keys as required by KKey::KKey(const TQString&).

Parameters
keySeqthe description of the key
See also
KKeyServer::Sym::init()
KKey::KKey(const TQString&)

Definition at line 215 of file tdeshortcut.cpp.

◆ ~KKeySequence()

KKeySequence::~KKeySequence ( )

Definition at line 217 of file tdeshortcut.cpp.

Member Function Documentation

◆ clear()

void KKeySequence::clear ( )

Clears the key sequence.

The key sequence is null after calling this function.

See also
isNull()

Definition at line 221 of file tdeshortcut.cpp.

◆ compare()

int KKeySequence::compare ( const KKeySequence &  keySeq) const

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.

Parameters
keySeqthe key sequence to compare to
Returns
a negative number if the given KKeySequence is larger, 0 if they are equal and a positive number this KKeySequence is larger
See also
KKey::sequence

Definition at line 334 of file tdeshortcut.cpp.

◆ count()

uint KKeySequence::count ( ) const

Returns the number of key strokes of this sequence.

Returns
the number of key strokes
See also
MAX_KEYS

Definition at line 289 of file tdeshortcut.cpp.

◆ init() [1/5]

bool KKeySequence::init ( const KKey &  key)

Initializes the key sequence to only contain the given key.

Parameters
keythe key to set
Returns
true if successful, false otherwise

Definition at line 242 of file tdeshortcut.cpp.

◆ init() [2/5]

bool KKeySequence::init ( const KKeyNative &  key)

Initializes the key sequence to only contain the given key.

Parameters
keythe key to set
Returns
true if successful, false otherwise

◆ init() [3/5]

bool KKeySequence::init ( const KKeySequence &  keySeq)

Copies the given key sequence over this key sequence.

Parameters
keySeqthe key sequence to copy
Returns
true if successful, false otherwise

Definition at line 253 of file tdeshortcut.cpp.

◆ init() [4/5]

bool KKeySequence::init ( const TQKeySequence &  keySeq)

Copies the given qt key sequence over this key sequence.

Parameters
keySeqthe qt key sequence to copy
Returns
true if successful, false otherwise

Definition at line 227 of file tdeshortcut.cpp.

◆ init() [5/5]

bool KKeySequence::init ( const TQString &  key)

Initializes this key sequence to contain the given key sequence.

The description consists of comma-separated keys as required by KKey::KKey(const TQString&).

Parameters
keythe description of the key
Returns
true if successful, false otherwise
See also
KKeyServer::Sym::init()
KKey::KKey(const TQString&)

Definition at line 268 of file tdeshortcut.cpp.

◆ isNull()

bool KKeySequence::isNull ( ) const

Returns true if the key sequence is null (after clear() or empty constructor).

Returns
true if the key sequence is null
See also
clear()
null()

Definition at line 316 of file tdeshortcut.cpp.

◆ isTriggerOnRelease()

bool KKeySequence::isTriggerOnRelease ( ) const

Definition at line 302 of file tdeshortcut.cpp.

◆ key()

const KKey & KKeySequence::key ( uint  i) const

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

Parameters
ithe key to retrieve
Returns
the i'th key, or KKey::null() if there are less than i keys
See also
MAX_KEYS

Definition at line 294 of file tdeshortcut.cpp.

◆ keyCodeQt()

int KKeySequence::keyCodeQt ( ) const

Returns the qt key code of the first key.

Returns
the qt key code of the first key
See also
TQt::Key
KKey::keyCodeQt()

Definition at line 357 of file tdeshortcut.cpp.

◆ null()

KKeySequence & KKeySequence::null ( )
static

Returns a null key sequence.

Returns
the null key sequence
See also
isNull()
clear()

Definition at line 390 of file tdeshortcut.cpp.

◆ operator!=()

bool KKeySequence::operator!= ( const KKeySequence &  seq) const
inline

Compares the keys of both sequences.

See also
compare()

Definition at line 463 of file tdeshortcut.h.

◆ operator<()

bool KKeySequence::operator< ( const KKeySequence &  seq) const
inline

Compares the keys of both sequences.

See also
compare()

Definition at line 470 of file tdeshortcut.h.

◆ operator=()

KKeySequence & KKeySequence::operator= ( const KKeySequence &  seq)
inline

Copy the given key sequence into this sequence.

Definition at line 387 of file tdeshortcut.h.

◆ operator==()

bool KKeySequence::operator== ( const KKeySequence &  seq) const
inline

Compares the keys of both sequences.

See also
compare()

Definition at line 456 of file tdeshortcut.h.

◆ qt()

TQKeySequence KKeySequence::qt ( ) const

Converts this key sequence to a TQKeySequence.

Returns
the QKeySequence

Definition at line 347 of file tdeshortcut.cpp.

◆ setKey()

bool KKeySequence::setKey ( uint  i,
const KKey &  key 
)

Sets the i'th key of the sequence.

You can not introduce gaps in a sequence, so you must use an i <= count(). Also note that the maximum length of a key sequence is MAX_KEYS.

Parameters
ithe position of the new key (<= count(), <= MAX_KEYS)
keythe key to set
Returns
true if successful, false otherwise

Definition at line 305 of file tdeshortcut.cpp.

◆ startsWith()

bool KKeySequence::startsWith ( const KKeySequence &  keySeq) const

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

Parameters
keySeqthe key sequence to search
Returns
true if this key sequence begins with the given sequence

Definition at line 321 of file tdeshortcut.cpp.

◆ toString()

TQString KKeySequence::toString ( ) const

Returns the key sequence as a number of key presses as returned by KKey::toString(), separated by commas.

Returns
the string represenation of this key sequence
See also
KKey::toString()

Definition at line 362 of file tdeshortcut.cpp.

◆ toStringInternal()

TQString KKeySequence::toStringInternal ( ) const

Definition at line 376 of file tdeshortcut.cpp.

Friends And Related Function Documentation

◆ KKeyNative

friend class KKeyNative
friend

Definition at line 517 of file tdeshortcut.h.

Member Data Documentation

◆ m_bTriggerOnRelease

uchar KKeySequence::m_bTriggerOnRelease
protected

Definition at line 511 of file tdeshortcut.h.

◆ m_nKeys

uchar KKeySequence::m_nKeys
protected

Definition at line 510 of file tdeshortcut.h.

◆ m_rgvar

KKey KKeySequence::m_rgvar[MAX_KEYS]
protected

Definition at line 513 of file tdeshortcut.h.


The documentation for this class was generated from the following files:
  • tdeshortcut.h
  • tdeshortcut.cpp

tdecore

Skip menu "tdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.4
This website is maintained by Timothy Pearson.