Class TermCode
#include <TermCode.h >
This class is useful for calculating escape sequences specific to a text-based video terminal.
Specifically, given a user keystroke name, calculate the terminal escape sequence understood by that terminal.
These are the valid keystroke names: space, enter, lf, tab, bs, esc, left, right, up, down, home, end, pgup, pgdn, ins, del.
const string& terminalType |
a valid terminal type, e.g. xterm, vt100, c64, h19, ansi |
Returns true if the terminal type is supported
Return value: true if terminaType is supported, false if not supported
const string& terminalType |
a valid terminal type, e.g. xterm, vt100, c64, h19, ansi |
const string& keyname |
the keyname, e.g. left, right, up, down, home, end, pgup, pgdn, ins, del, etc. |
Given a terminal type and keyname, return the characters for it
Return value: the escape sequence that the terminal accepts to understand the named key
string keyname |
the keyname, e.g. left, right, up, down, home, end, pgup, pgdn, ins, del, etc. |
Given a key name, return the H19 characte(s) for it
Return value: the escape sequence that the terminal accepts to understand the named key
string keyname |
the keyname, e.g. left, right, up, down, home, end, pgup, pgdn, ins, del, etc. |
Given a key name, return the ANSI characte(s) for it
Return value: the escape sequence that the terminal accepts to understand the named key
string keyname |
the keyname, e.g. left, right, up, down, home, end, pgup, pgdn, ins, del, etc. |
Given a key name, return the xterm characte(s) for it
Return value: the escape sequence that the terminal accepts to understand the named key
bool shift |
true means use the shiftPrefix + coreText + postfix, false otherwise |
const string& shiftPrefix |
the start of the shift prefix |
bool ctrl |
true means use the ctrlPrefix + coreText + postfix, false otherwise |
const string& ctrlPrefix |
the start of the ctrl prefix |
bool alt |
true means use the altPrefix + coreText + postfix, false otherwise |
const string& altPrefix |
the start of the alt prefix |
const string& plainPrefix |
the start of the plain (non-shift/ctrl/alt) prefix |
const string& coreText |
the core text of the escape esquence |
const string& postfix |
the trailing character (the command) Default value: "" |
Compile an escape sequence for xterm by selecting the appropriate prefix.
The result will start with one of shfitPrefix, ctrlPrefix, altPrefix or plainPrefix, which is followed by coreText and postfix.
Return value: an escape sequence