Konsole::KeyboardTranslator::Entry
#include <KeyboardTranslator.h>
Public Member Functions | |
Entry () | |
Command | command () const |
QString | conditionToString () const |
QByteArray | escapedText (bool expandWildCards=false, Qt::KeyboardModifiers modifiers=Qt::NoModifier) const |
bool | isNull () const |
int | keyCode () const |
bool | matches (int keyCode, Qt::KeyboardModifiers modifiers, States flags) const |
Qt::KeyboardModifiers | modifierMask () const |
Qt::KeyboardModifiers | modifiers () const |
bool | operator== (const Entry &rhs) const |
QString | resultToString (bool expandWildCards=false, Qt::KeyboardModifiers modifiers=Qt::NoModifier) const |
void | setCommand (Command command) |
void | setKeyCode (int keyCode) |
void | setModifierMask (Qt::KeyboardModifiers modifiers) |
void | setModifiers (Qt::KeyboardModifiers modifiers) |
void | setState (States state) |
void | setStateMask (States mask) |
void | setText (const QByteArray &text) |
States | state () const |
States | stateMask () const |
QByteArray | text (bool expandWildCards=false, Qt::KeyboardModifiers modifiers=Qt::NoModifier) const |
Detailed Description
Represents an association between a key sequence pressed by the user and the character sequence and commands associated with it for a particular KeyboardTranslator.
Definition at line 123 of file KeyboardTranslator.h.
Constructor & Destructor Documentation
◆ Entry()
KeyboardTranslator::Entry::Entry | ( | ) |
Constructs a new entry for a keyboard translator.
Definition at line 562 of file KeyboardTranslator.cpp.
Member Function Documentation
◆ command()
|
inline |
Returns the commands associated with this entry.
Definition at line 536 of file KeyboardTranslator.h.
◆ conditionToString()
QString KeyboardTranslator::Entry::conditionToString | ( | ) | const |
Returns the key code and modifiers associated with this entry as a QKeySequence.
Returns this entry's conditions ( ie. its key code, modifier and state criteria ) as a string.
Definition at line 780 of file KeyboardTranslator.cpp.
◆ escapedText()
QByteArray KeyboardTranslator::Entry::escapedText | ( | bool | expandWildCards = false, |
Qt::KeyboardModifiers | modifiers = Qt::NoModifier ) const |
Returns the character sequence associated with this entry, with any non-printable characters replaced with escape sequences.
eg. \E for Escape, \t for tab, \n for new line.
Definition at line 609 of file KeyboardTranslator.cpp.
◆ isNull()
|
inline |
Returns true if this entry is null.
This is true for newly constructed entries which have no properties set.
Definition at line 527 of file KeyboardTranslator.h.
◆ keyCode()
|
inline |
Returns the character code ( from the Qt::Key enum ) associated with this entry.
Definition at line 500 of file KeyboardTranslator.h.
◆ matches()
bool KeyboardTranslator::Entry::matches | ( | int | keyCode, |
Qt::KeyboardModifiers | modifiers, | ||
States | flags ) const |
Returns true if this entry matches the given key sequence, specified as a combination of keyCode
, modifiers
and state
.
Definition at line 578 of file KeyboardTranslator.cpp.
◆ modifierMask()
|
inline |
Returns the keyboard modifiers which are valid in this entry.
See modifiers()
Definition at line 522 of file KeyboardTranslator.h.
◆ modifiers()
|
inline |
Returns a bitwise-OR of the enabled keyboard modifiers associated with this entry.
If a modifier is set in modifierMask() but not in modifiers(), this means that the entry only matches when that modifier is NOT pressed.
If a modifier is not set in modifierMask() then the entry matches whether the modifier is pressed or not.
Definition at line 513 of file KeyboardTranslator.h.
◆ operator==()
bool KeyboardTranslator::Entry::operator== | ( | const Entry & | rhs | ) | const |
Definition at line 572 of file KeyboardTranslator.cpp.
◆ resultToString()
QString KeyboardTranslator::Entry::resultToString | ( | bool | expandWildCards = false, |
Qt::KeyboardModifiers | modifiers = Qt::NoModifier ) const |
Returns this entry's result ( ie.
its command or character sequence ) as a string.
Definition at line 757 of file KeyboardTranslator.cpp.
◆ setCommand()
|
inline |
Sets the command associated with this entry.
Definition at line 532 of file KeyboardTranslator.h.
◆ setKeyCode()
|
inline |
Sets the character code associated with this entry.
Definition at line 504 of file KeyboardTranslator.h.
◆ setModifierMask()
|
inline |
See modifierMask() and modifiers()
Definition at line 518 of file KeyboardTranslator.h.
◆ setModifiers()
|
inline |
See modifiers()
Definition at line 509 of file KeyboardTranslator.h.
◆ setState()
|
inline |
See state()
Definition at line 568 of file KeyboardTranslator.h.
◆ setStateMask()
|
inline |
See stateMask()
Definition at line 577 of file KeyboardTranslator.h.
◆ setText()
|
inline |
Sets the character sequence associated with this entry.
Definition at line 541 of file KeyboardTranslator.h.
◆ state()
|
inline |
Returns a bitwise-OR of the enabled state flags associated with this entry.
If flag is set in stateMask() but not in state(), this means that the entry only matches when the terminal is NOT in that state.
If a state is not set in stateMask() then the entry matches whether the terminal is in that state or not.
Definition at line 572 of file KeyboardTranslator.h.
◆ stateMask()
|
inline |
Returns the state flags which are valid in this entry.
See state()
Definition at line 581 of file KeyboardTranslator.h.
◆ text()
|
inline |
Returns the character sequence associated with this entry, optionally replacing wildcard '*' characters with numbers to indicate the keyboard modifiers being pressed.
TODO: The numbers used to replace '*' characters are taken from the Konsole/KDE 3 code. Document them.
- Parameters
-
expandWildCards Specifies whether wild cards (occurrences of the '*' character) in the entry should be replaced with a number to indicate the modifier keys being pressed. modifiers The keyboard modifiers being pressed.
Definition at line 549 of file KeyboardTranslator.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:08:41 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.