MauiKit Terminal
KeyboardTranslator.h
154 QByteArray text(bool expandWildCards = false, Qt::KeyboardModifiers modifiers = Qt::NoModifier) const;
168 QByteArray escapedText(bool expandWildCards = false, Qt::KeyboardModifiers modifiers = Qt::NoModifier) const;
230 QString resultToString(bool expandWildCards = false, Qt::KeyboardModifiers modifiers = Qt::NoModifier) const;
495 QHash<QString, KeyboardTranslator *> _translators; // maps translator-name -> KeyboardTranslator
549inline QByteArray KeyboardTranslator::Entry::text(bool expandWildCards, Qt::KeyboardModifiers modifiers) const
KeyboardTranslatorManager()
Constructs a new KeyboardTranslatorManager and loads the list of available keyboard translations.
Definition KeyboardTranslator.cpp:56
const KeyboardTranslator * defaultTranslator()
Returns the default translator for Konsole.
Definition KeyboardTranslator.cpp:161
QList< QString > allTranslators()
Returns a list of the names of available keyboard translators.
Definition KeyboardTranslator.cpp:553
const KeyboardTranslator * findTranslator(const QString &name)
Returns the keyboard translator with the given name or 0 if no translator with that name exists.
Definition KeyboardTranslator.cpp:99
void addTranslator(KeyboardTranslator *translator)
Adds a new translator.
Definition KeyboardTranslator.cpp:851
bool deleteTranslator(const QString &name)
Deletes a translator.
Definition KeyboardTranslator.cpp:858
static KeyboardTranslatorManager * instance()
Returns the global KeyboardTranslatorManager instance.
Definition KeyboardTranslator.cpp:873
static KeyboardTranslator::Entry createEntry(const QString &condition, const QString &result)
Parses a condition and result string for a translator entry and produces a keyboard translator entry.
Definition KeyboardTranslator.cpp:458
KeyboardTranslatorReader(QIODevice *source)
Constructs a new reader which parses the given source.
Definition KeyboardTranslator.cpp:238
bool parseError()
Returns true if an error occurred whilst parsing the input or false if no error occurred.
Definition KeyboardTranslator.cpp:492
bool hasNextEntry() const
Returns true if there is another entry in the source stream.
Definition KeyboardTranslator.cpp:454
KeyboardTranslator::Entry nextEntry()
Returns the next entry found in the source stream.
Definition KeyboardTranslator.cpp:485
void writeHeader(const QString &description)
Writes the header for the keyboard translator.
Definition KeyboardTranslator.cpp:204
void writeEntry(const KeyboardTranslator::Entry &entry)
Writes a translator entry.
Definition KeyboardTranslator.cpp:208
KeyboardTranslatorWriter(QIODevice *destination)
Constructs a new writer which saves data into destination.
Definition KeyboardTranslator.cpp:193
Represents an association between a key sequence pressed by the user and the character sequence and c...
Definition KeyboardTranslator.h:124
Command command() const
Returns the commands associated with this entry.
Definition KeyboardTranslator.h:536
void setModifierMask(Qt::KeyboardModifiers modifiers)
See modifierMask() and modifiers()
Definition KeyboardTranslator.h:518
Qt::KeyboardModifiers modifierMask() const
Returns the keyboard modifiers which are valid in this entry.
Definition KeyboardTranslator.h:522
States state() const
Returns a bitwise-OR of the enabled state flags associated with this entry.
Definition KeyboardTranslator.h:572
void setModifiers(Qt::KeyboardModifiers modifiers)
See modifiers()
Definition KeyboardTranslator.h:509
int keyCode() const
Returns the character code ( from the Qt::Key enum ) associated with this entry.
Definition KeyboardTranslator.h:500
States stateMask() const
Returns the state flags which are valid in this entry.
Definition KeyboardTranslator.h:581
QString resultToString(bool expandWildCards=false, Qt::KeyboardModifiers modifiers=Qt::NoModifier) const
Returns this entry's result ( ie.
Definition KeyboardTranslator.cpp:757
QString conditionToString() const
Returns the key code and modifiers associated with this entry as a QKeySequence.
Definition KeyboardTranslator.cpp:780
Qt::KeyboardModifiers modifiers() const
Returns a bitwise-OR of the enabled keyboard modifiers associated with this entry.
Definition KeyboardTranslator.h:513
void setKeyCode(int keyCode)
Sets the character code associated with this entry.
Definition KeyboardTranslator.h:504
void setCommand(Command command)
Sets the command associated with this entry.
Definition KeyboardTranslator.h:532
bool 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 ,...
Definition KeyboardTranslator.cpp:578
QByteArray escapedText(bool expandWildCards=false, Qt::KeyboardModifiers modifiers=Qt::NoModifier) const
Returns the character sequence associated with this entry, with any non-printable characters replaced...
Definition KeyboardTranslator.cpp:609
QByteArray text(bool expandWildCards=false, Qt::KeyboardModifiers modifiers=Qt::NoModifier) const
Returns the character sequence associated with this entry, optionally replacing wildcard '*' characte...
Definition KeyboardTranslator.h:549
void setText(const QByteArray &text)
Sets the character sequence associated with this entry.
Definition KeyboardTranslator.h:541
A convertor which maps between key sequences pressed by the user and the character strings which shou...
Definition KeyboardTranslator.h:53
QString name() const
Returns the name of this keyboard translator.
Definition KeyboardTranslator.cpp:817
Entry findEntry(int keyCode, Qt::KeyboardModifiers modifiers, States state=NoState) const
Looks for an entry in this keyboard translator which matches the given key code, keyboard modifiers a...
Definition KeyboardTranslator.cpp:842
QString description() const
Returns the descriptive name of this keyboard translator.
Definition KeyboardTranslator.cpp:809
static const Qt::KeyboardModifier CTRL_MOD
The modifier code for the actual Ctrl key on this OS.
Definition KeyboardTranslator.h:306
void replaceEntry(const Entry &existing, const Entry &replacement)
Replaces an entry in the translator.
Definition KeyboardTranslator.cpp:832
void setName(const QString &name)
Sets the name of this keyboard translator.
Definition KeyboardTranslator.cpp:813
State
The meaning of a particular key sequence may depend upon the state which the terminal emulation is in...
Definition KeyboardTranslator.h:63
@ AlternateScreenState
Indicates that the alternate screen ( typically used by interactive programs such as screen or vim ) ...
Definition KeyboardTranslator.h:83
@ AnyModifierState
Indicates that any of the modifier keys is active.
Definition KeyboardTranslator.h:85
@ ApplicationKeypadState
Indicates that the numpad is in application mode.
Definition KeyboardTranslator.h:87
QList< Entry > entries() const
Returns a list of all entries in the translator.
Definition KeyboardTranslator.cpp:822
Command
This enum describes commands which are associated with particular key sequences.
Definition KeyboardTranslator.h:94
@ NoCommand
Indicates that no command is associated with this command sequence.
Definition KeyboardTranslator.h:96
@ EraseCommand
Echos the operating system specific erase character.
Definition KeyboardTranslator.h:114
@ ScrollPageDownCommand
Scroll the terminal display down one page.
Definition KeyboardTranslator.h:102
@ ScrollDownToBottomCommand
Scroll the terminal display down to the end of history.
Definition KeyboardTranslator.h:112
@ ScrollUpToTopCommand
Scroll the terminal display up to the start of history.
Definition KeyboardTranslator.h:110
@ ScrollLineDownCommand
Scroll the terminal display down one line.
Definition KeyboardTranslator.h:106
KeyboardTranslator(const QString &name)
Constructs a new keyboard translator with the given name.
Definition KeyboardTranslator.cpp:800
void setDescription(const QString &description)
Sets the descriptive name of this keyboard translator.
Definition KeyboardTranslator.cpp:805
void addEntry(const Entry &entry)
Adds an entry to this keyboard translator's table.
Definition KeyboardTranslator.cpp:827
void removeEntry(const Entry &entry)
Removes an entry from the table.
Definition KeyboardTranslator.cpp:838
typedef KeyboardModifiers
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Feb 21 2025 11:50:35 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Feb 21 2025 11:50:35 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.