Konsole
Konsole::KeyboardTranslator Class Reference
#include <KeyboardTranslator.h>
Detailed Description
A convertor 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 51 of file KeyboardTranslator.h.
Public Types | |
| enum | State { NoState = 0, NewLineState = 1, AnsiState = 2, CursorKeysState = 4, AlternateScreenState = 8, AnyModifierState = 16 } |
| enum | Command { NoCommand = 0, SendCommand = 1, ScrollPageUpCommand = 2, ScrollPageDownCommand = 4, ScrollLineUpCommand = 8, ScrollLineDownCommand = 16, ScrollLockCommand = 32, EraseCommand = 64 } |
Public Member Functions | |
| KeyboardTranslator (const QString &name) | |
| QString | name () const |
| void | setName (const QString &name) |
| QString | description () const |
| void | setDescription (const QString &description) |
| Entry | findEntry (int keyCode, Qt::KeyboardModifiers modifiers, States state=NoState) const |
| void | addEntry (const Entry &entry) |
| void | replaceEntry (const Entry &existing, const Entry &replacement) |
| void | removeEntry (const Entry &entry) |
| QList< Entry > | entries () const |
Classes | |
| class | Entry |
| Represents an association between a key sequence pressed by the user and the character sequence and commands associated with it for a particular KeyboardTranslator. More... | |
Member Enumeration Documentation
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 with a particular entry in the keyboard translation entry.
- Enumerator:
Definition at line 62 of file KeyboardTranslator.h.
This enum describes commands which are associated with particular key sequences.
- Enumerator:
Definition at line 92 of file KeyboardTranslator.h.
Constructor & Destructor Documentation
| KeyboardTranslator::KeyboardTranslator | ( | const QString & | name | ) |
Constructs a new keyboard translator with the given name.
Definition at line 786 of file KeyboardTranslator.cpp.
Member Function Documentation
| QString KeyboardTranslator::name | ( | ) | const |
Returns the name of this keyboard translator.
Definition at line 803 of file KeyboardTranslator.cpp.
| void KeyboardTranslator::setName | ( | const QString & | name | ) |
| QString KeyboardTranslator::description | ( | ) | const |
Returns the descriptive name of this keyboard translator.
Definition at line 795 of file KeyboardTranslator.cpp.
| void KeyboardTranslator::setDescription | ( | const QString & | description | ) |
Sets the descriptive name of this keyboard translator.
Definition at line 791 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 828 of file KeyboardTranslator.cpp.
| 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 813 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 818 of file KeyboardTranslator.cpp.
| void KeyboardTranslator::removeEntry | ( | const Entry & | entry | ) |
| QList< KeyboardTranslator::Entry > KeyboardTranslator::entries | ( | ) | const |
Returns a list of all entries in the translator.
Definition at line 808 of file KeyboardTranslator.cpp.
The documentation for this class was generated from the following files:
KDE 4.0 API Reference