Skip to content

Modern Tui TuiInput

Paul Squires edited this page Oct 19, 2026 · 6 revisions

Home › Terminal TUI Library › Events › TuiInput

TuiInput

Holds the parser that turns raw terminal bytes into events.

Syntax

type TuiInput
    declare sub Feed( byref bytes as string )
    declare function NextEvent( byval escExpired as boolean = FALSE ) as TuiEventOpt
    ...
end type

Description

The VT parser. Feed it bytes, take events out. You need this only when driving your own loop -- and it is also how the module's own input tests work, with no terminal at all.

Example

#import "std/tui"
using tui

dim as TuiInput keys
keys.Feed( chr( 27 ) & "[A" )              '' CSI A -- cursor up

dim as TuiEventOpt ev = keys.NextEvent( )
print ev.HasValue( )                       '' true
print ev.Value( ).key.code = TUIKEY_UP '' -1 (true)

See also

TuiEvent TuiKey.IsChar TuiMouse TuiInput.Feed TuiInput.PushEvent TuiInput.Buffered
TuiKey TuiKey.HasMod TuiKeyName TuiInput.NextEvent TuiInput.Reset TuiInput.Queued

Library: Terminal TUI Library
Category: Terminal TUI Library
Documented under: Events
Working examples: hello.tiko · form.tiko · dashboard.tiko


Home · Keyword Index

Clone this wiki locally