Konsole
#include <KeyboardTranslator.h>
Classes | |
class | Entry |
Public Types | |
enum | Command { NoCommand = 0, SendCommand = 1, ScrollPageUpCommand = 2, ScrollPageDownCommand = 4, ScrollLineUpCommand = 8, ScrollLineDownCommand = 16, ScrollUpToTopCommand = 32, ScrollDownToBottomCommand = 64, EraseCommand = 256 } |
enum | State { NoState = 0, NewLineState = 1, AnsiState = 2, CursorKeysState = 4, AlternateScreenState = 8, AnyModifierState = 16, ApplicationKeypadState = 32 } |
Public Member Functions | |
KeyboardTranslator (const QString &name) | |
void | addEntry (const Entry &entry) |
QString | description () const |
QList< Entry > | entries () const |
Entry | findEntry (int keyCode, Qt::KeyboardModifiers modifiers, States state=NoState) const |
QString | name () const |
void | removeEntry (const Entry &entry) |
void | replaceEntry (const Entry &existing, const Entry &replacement) |
void | setDescription (const QString &description) |
void | setName (const QString &name) |
Detailed Description
A converter which maps between key sequences pressed by the user and the character strings which should be sent to the terminal and commands which should be invoked when those character sequences are pressed.
Konsole supports multiple keyboard translators, allowing the user to specify the character sequences which are sent to the terminal when particular key sequences are pressed.
A key sequence is defined as a key code, associated keyboard modifiers (Shift,Ctrl,Alt,Meta etc.) and state flags which indicate the state which the terminal must be in for the key sequence to apply.
Definition at line 52 of file KeyboardTranslator.h.
Member Enumeration Documentation
This enum describes commands which are associated with particular key sequences.
Definition at line 94 of file KeyboardTranslator.h.
The meaning of a particular key sequence may depend upon the state which the terminal emulation is in.
Therefore findEntry() may return a different Entry depending upon the state flags supplied.
This enum describes the states which may be associated with a particular entry in the keyboard translation entry.
Definition at line 63 of file KeyboardTranslator.h.
Constructor & Destructor Documentation
|
explicit |
Constructs a new keyboard translator with the given name
.
Definition at line 619 of file KeyboardTranslator.cpp.
Member Function Documentation
void KeyboardTranslator::addEntry | ( | const Entry & | entry | ) |
Adds an entry to this keyboard translator's table.
Entries can be looked up according to their key sequence using findEntry()
Definition at line 661 of file KeyboardTranslator.cpp.
QString KeyboardTranslator::description | ( | ) | const |
Returns the descriptive name of this keyboard translator.
Definition at line 641 of file KeyboardTranslator.cpp.
QList< KeyboardTranslator::Entry > KeyboardTranslator::entries | ( | ) | const |
Returns a list of all entries in the translator.
Definition at line 656 of file KeyboardTranslator.cpp.
KeyboardTranslator::Entry KeyboardTranslator::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 and state flags.
Returns the matching entry if found or a null Entry otherwise ( ie. entry.isNull() will return true )
- Parameters
-
keyCode A key code from the Qt::Key enum modifiers A combination of modifiers state Optional flags which specify the current state of the terminal
Definition at line 680 of file KeyboardTranslator.cpp.
QString KeyboardTranslator::name | ( | ) | const |
Returns the name of this keyboard translator.
Definition at line 651 of file KeyboardTranslator.cpp.
void KeyboardTranslator::removeEntry | ( | const Entry & | entry | ) |
Removes an entry from the table.
Definition at line 675 of file KeyboardTranslator.cpp.
Replaces an entry in the translator.
If the existing
entry is null, then this is equivalent to calling addEntry(replacement
)
Definition at line 667 of file KeyboardTranslator.cpp.
void KeyboardTranslator::setDescription | ( | const QString & | description | ) |
Sets the descriptive name of this keyboard translator.
Definition at line 636 of file KeyboardTranslator.cpp.
void KeyboardTranslator::setName | ( | const QString & | name | ) |
Sets the name of this keyboard translator.
Definition at line 646 of file KeyboardTranslator.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:28 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.