I/O Overview¶
Functui has multiple modules of doing input and output.
See also
Generally input functions will return an InputEvent
which stores the input in a special string format. That format is specified
in String Key Codes Specification.
functui.io.raw¶
Recomended for all interactive applications. (keyboard and mouse).
Used the functui.io.ansi to render.
Input - ✅¶
Full mouse and keyboard support.
Output - ✅¶
Displays the layout with ansi escape codes.
See also
terminal() and Interactive examples using the elm architecture.
Also Interactivity has a detailed guide on how to use this module.
functui.io.ansi¶
Recommended if you need functui just for rendering.
Input - ❌¶
For very simple projects you may use python’s build in input().
Otherwise, there is no build in way to get a functui.classes.InputEvent with this io method.
Output - ✅¶
Renders a layout as a string with ansi escape codes which are supported by virtually all terminals. Then you can simply just use the print() function to display that string.
Quirks¶
Output performance is not the best..
See also
layout_to_str() and result_to_str() for output. And ELM Counter App with ansi IO example.
functui.io.curses¶
Recommended for legacy interactive applications on unix.
Input - ✅¶
Full mouse and keyboard support.
Output - ✅¶
Displays the layout in a curses window.
Quirks¶
Does not work on windows.
Does not support True Color (rgb colors)
Only 256 unique foreground and background combinations may be used at a time.
STRIKE_THROUGHstyle is not supported
See also
wrapper(), get_input_event(), draw_result() and Template for ELM projects using curses IO example.
functui.io.html¶
Input - ❌¶
No input support.
Output - ✅¶
Wraps the layout in a <pre> tag.
Quirks¶
DIMis not supported.
To display functui layouts on the web.