terminalgui  0.1.0
Widgets for your terminal, powered by Qt! Create textual GUI (TUI) in your console easily.
Functions | Variables
Tg::Command Namespace Reference

Various ANSI code commands. More...

Functions

QString moveToPosition (const int x, const int y)
 Returns terminal command which will move the cursor to position x, y. More...
 

Variables

const QString ansiEscape = "\033["
 This string begins all ASCI controll sequences.
 
const QChar ansiEscapeEnd = 'm'
 Common ending character for many ANSI codes.
 
const QChar ansiPositionEnd = 'H'
 Ending character when specifying cursor position.
 
const QString up = ansiEscape + "1A"
 Up arrow code. More...
 
const QString down = ansiEscape + "1B"
 Down arrow code. More...
 
const QString forward = ansiEscape + "1C"
 Right arrow code. More...
 
const QString backward = ansiEscape + "1D"
 Left arrow code. More...
 
const QString clear = ansiEscape + "2J"
 Clears whole terminal screen.
 
const QString erase = ansiEscape + 'K'
 Clears whole terminal screen (?).
 
const QString save = ansiEscape + 's'
 Saves terminal state.
 
const QString restore = ansiEscape + 'u'
 Restores terminal state.
 
const QString colorEnd = ansiEscape + '0' + ansiEscapeEnd
 Ends ANSI Color definition.
 
const QChar separator = ';'
 Common separator between ANSI sequence parts.
 
const QString bold = ansiEscape + '1' + ansiEscapeEnd
 Set font weight to bold (on some terminals).
 
const QString resetFontSettings = colorEnd
 Resets font settings.
 
const QChar on = 'h'
 Sets some bit to "high" ("enabled" or "on").
 
const QChar off = 'l'
 Sets some bit to "low" ("disabled", or "off");.
 
const QString mouseClickReporting = ansiEscape + "?1000" + on
 Sequence which enables mouse click reporting (but not mouse move).
 
const QString mouseExtendedCoordinates = ansiEscape + "?1006" + on
 Enables extended mouse coordinates (for terminals bigger than ~120 columns).
 
const QString mouseMovementReporting = ansiEscape + "?1003" + on
 Enables extended mouse reporting (hover tracking).
 
const QString mouseEndReporting = ansiEscape + "?1000" + off
 End mouse state reporting.
 
const QString mouseEventBegin = ansiEscape + '<'
 Beginning of a mouse event.
 
const QChar mousePressSuffix = 'M'
 Indicates a mouse press.
 
const QChar mouseReleaseSuffix = 'm'
 Indicates a mouse release.
 
const QString mouseClick = mouseEventBegin + "0" + separator
 Indicates a mouse click.
 
const QString mouseWheelUp = mouseEventBegin + "64" + separator
 Indicates a mouse wheel up event.
 
const QString mouseWheelDown = mouseEventBegin + "65" + separator
 Indicates a mouse wheel down event.
 
const QString mouseMoveEvent = mouseEventBegin + "35" + separator
 Indicates a mouse wheel down event.
 

Detailed Description

Various ANSI code commands.

For more information, take a look at:

Function Documentation

◆ moveToPosition()

QString Tg::Command::moveToPosition ( const int  x,
const int  y 
)

Returns terminal command which will move the cursor to position x, y.

Warning
x and y start in top left corner of the screen and they both start with 1 (one), not zero!

Variable Documentation

◆ backward

const QString Tg::Command::backward = ansiEscape + "1D"

Left arrow code.

Todo:
Move to Tg::Key?

◆ down

const QString Tg::Command::down = ansiEscape + "1B"

Down arrow code.

Todo:
Move to Tg::Key?

◆ forward

const QString Tg::Command::forward = ansiEscape + "1C"

Right arrow code.

Todo:
Move to Tg::Key?

◆ up

const QString Tg::Command::up = ansiEscape + "1A"

Up arrow code.

Todo:
Move to Tg::Key?