Back to Projects
TUIX v0.5Beta

Last Updated: 2026-05-20

Input Widget

Input is a single-line text entry widget with placeholder text, cursor movement, editable current text, and submit state.

Creating An Input Widget

uid = objects.create_object(builders.INPUT, 'Main', 0.5, 0.08, 0.45, 0.25)
field = objects.get_object_by_uid(uid)
objects.tuix_input_set_placeholder(field, 'Type here...')
scenes.set_focus('Main', uid)

API Functions

FunctionDescription
objects.tuix_input_set_placeholder(obj, text)Sets placeholder text.
objects.tuix_input_is_submitted(obj)Returns non-zero when Enter submits the field.
objects.tuix_input_get_result(obj)Returns submitted text as bytes or None.
objects.tuix_input_get_text(obj)Returns current text as bytes.
objects.tuix_input_reset(obj)Clears submit state.
objects.tuix_input_feed_input(obj, snap)Compatibility helper; not required in normal frame-loop usage.

Example

while True:
    engine.main_loop()
    if objects.tuix_input_is_submitted(field):
        value = objects.tuix_input_get_result(field)
        break