KewtApp

Represents a Kewt application instance.

Managed the application lifecycle, input dispatching, state observation, and rendering.

Parameters

parentScope

The coroutine scope from which the application scope is derived.

Properties

Link copied to clipboard
val attributes: MutableMap<String, Any?>

A map of arbitrary attributes associated with this application instance. Can be used by framework extensions to store persistent state.

Functions

Link copied to clipboard
fun every(interval: Duration, block: () -> Unit)

Schedules a repeated background task.

Link copied to clipboard
fun exit()

Stops the application and exits the main loop.

Link copied to clipboard
fun onBackTab(handler: () -> Unit)

Registers a handler for the Shift-Tab (BackTab) key.

Link copied to clipboard
fun onKey(char: Char, handler: () -> Unit)

Registers a handler for a simple character key press.

fun onKey(key: Key, modifiers: Set<KeyModifier>, handler: () -> Unit)

Registers a handler for a specific key combination (key plus modifiers).

Link copied to clipboard
fun onKeyEvent(handler: (KeyEvent) -> Unit)

Registers a low-level key event handler.

Link copied to clipboard
fun onTab(handler: () -> Unit)

Registers a handler for the Tab key.

Link copied to clipboard
fun view(block: Buffer.() -> Unit)

Sets the main view function for the application.