Termbox
Inherits Termbox::Event
A thin wrapper around Termbox 2.
Class methods
Instance methods
Changes the attributes of the cell at x, y. fill specifies the character that is used when the referred cell has no content, otherwise, existing cell content is used.
Clears the internal back buffer using NormalColor::Default
or the color/attributes set by clear(fg, bg).
Finalizes Termbox. Must be called after successful initialization. Does nothing if Termbox is off already.
Initializes Termbox for the duration of the block.
- If nap is
nil, waits for an event indefinitely before calling the block. - If nap is not
nil, checks if an event in a non-blocking manner; and yields that event (ornilif none) to the block. After the block, sleeps for nap.
Initializes Termbox. Must be called before any other function. If Termbox is already on, does nothing.
Waits for an event up to timeout and returns a BaseEvent,
or nil if no event is available within the timeout.
Waits for an event up to timeout milliseconds and
returns a BaseEvent, or nil if no event is available
within the timeout.
Prints the string representation of object at the given position, with the given foreground and background attributes.
Prints the string representation of object at the given
position with default attributes (see Color::Default).
Moves the cursor to the specified position (in rows, cols). Upper-left corner is at (0, 0). The cursor is shown if it was hidden.
Sets the input mode (see InputMode). The default mode
is InputMode::Escape.
Sets the termbox output mode (see OutputMode).
Note that not all terminals support all output modes,
especially beyond OutputMode::Normal. There is also no
very reliable way to determine color support dynamically.
If portability is desired, users are recommended to use
OutputMode::Normal or make output mode end-user configurable.