20 #ifndef __TDESHORTCUT_H
21 #define __TDESHORTCUT_H
23 #include <tqkeysequence.h>
25 #include "tdelibs_export.h"
47 enum { MOD_FLAG_COUNT = 4 };
48 enum { QtWIN = (TQt::META) };
79 KKey(
const TQKeySequence& keySeq );
85 KKey(
const TQKeyEvent* keyEvent );
100 KKey(
const TQString& key );
104 KKey( uint key, uint mod );
120 bool init(
int keyQt );
127 bool init(
const TQKeySequence& keySeq );
134 bool init(
const TQKeyEvent* keyEvent );
141 bool init(
const KKey& key );
152 bool init(
const TQString& key);
157 bool init( uint key, uint mod );
163 { init( key );
return *
this; }
182 uint modFlags()
const;
195 int compare(
const KKey& key )
const;
201 bool operator == (
const KKey& key )
const
202 {
return compare( key ) == 0; }
207 bool operator != (
const KKey& key )
const
208 {
return compare( key ) != 0; }
213 bool operator < (
const KKey& key )
const
214 {
return compare( key ) < 0; }
222 int keyCodeQt()
const;
231 TQString toString()
const;
237 TQString toStringInternal()
const;
258 static TQString modFlagLabel( ModFlag f );
292 enum { MAX_KEYS = 4 };
350 bool init(
const TQKeySequence& keySeq );
357 bool init(
const KKey& key );
382 bool init(
const TQString& key );
388 { init( seq );
return *
this; }
405 const KKey& key( uint i )
const;
410 bool isTriggerOnRelease()
const;
420 bool setKey( uint i,
const KKey& key );
457 {
return compare( seq ) == 0; }
464 {
return compare( seq ) != 0; }
471 {
return compare( seq ) < 0; }
478 TQKeySequence qt()
const;
486 int keyCodeQt()
const;
494 TQString toString()
const;
499 TQString toStringInternal()
const;
511 uchar m_bTriggerOnRelease;
513 KKey m_rgvar[MAX_KEYS];
516 class KKeySequencePrivate* d;
550 enum { MAX_SEQUENCES = 2 };
627 bool init(
int keyQt );
633 bool init(
const TQKeySequence& keySeq );
639 bool init(
const KKey& key );
660 bool init(
const TQString& shortcut );
666 { init( cut );
return *
this; }
692 int keyCodeQt()
const;
723 {
return compare( cut ) == 0; }
730 {
return compare( cut ) != 0; }
737 {
return compare( cut ) < 0; }
745 bool contains(
const KKey& key )
const;
798 bool append(
const KKey& spec );
813 operator TQKeySequence ()
const;
822 TQString toString()
const;
827 TQString toStringInternal(
const TDEShortcut* pcutDefault = 0 )
const;
842 class TDEShortcutPrivate* d;
845 #ifndef KDE_NO_COMPAT
847 operator int ()
const {
return keyCodeQt(); }
Representation of a key in the format native of the windowing system (eg.
int keyCodeQt() const
Returns the qt key code.
A KKeySequence object holds a sequence of up to 4 keys.
bool init(const KKeyNative &key)
Initializes the key sequence to only contain the given key.
KKeySequence(const KKeyNative &key)
Create a new key sequence that only contains the given key.
A KKey object represents a single key with possible modifiers (Shift, Ctrl, Alt, Win).
ModFlag
Flags to represent the modifiers.
The TDEShortcut class is used to represent a keyboard shortcut to an action.