Jazz2::UI::Menu::TextInputBuffer class

Helper class that manages text editing state for text input fields.

Constructors, destructors, conversion operators

TextInputBuffer(std::uint32_t maxLength = UINT32_MAX) explicit

Public functions

auto IsActive() const -> bool
void Activate(StringView initialText = {})
void Deactivate()
auto GetText() const -> StringView
auto GetCursor() const -> std::size_t
auto GetCaretAnim() const -> float
void Update(float timeMult)
auto OnKeyPressed(const nCine::KeyboardEvent& event) -> bool
Handles editing keys (Backspace, Delete, arrow keys, Home, End).
auto OnTextInput(const nCine::TextInputEvent& event) -> bool
Inserts text at the current cursor position.

Function documentation

bool Jazz2::UI::Menu::TextInputBuffer::OnKeyPressed(const nCine::KeyboardEvent& event)

Handles editing keys (Backspace, Delete, arrow keys, Home, End).

Returns true if the event was consumed.

bool Jazz2::UI::Menu::TextInputBuffer::OnTextInput(const nCine::TextInputEvent& event)

Inserts text at the current cursor position.

Returns true if the text was inserted.