aboutsummaryrefslogtreecommitdiff
path: root/modules/TUI/module.jai
diff options
context:
space:
mode:
Diffstat (limited to 'modules/TUI/module.jai')
-rw-r--r--modules/TUI/module.jai17
1 files changed, 15 insertions, 2 deletions
diff --git a/modules/TUI/module.jai b/modules/TUI/module.jai
index fb742da..d0373f9 100644
--- a/modules/TUI/module.jai
+++ b/modules/TUI/module.jai
@@ -1,3 +1,16 @@
+/*
+ A simple terminal user interface module that provides basic functionalities similar to the [ncurses library](https://en.wikipedia.org/wiki/Ncurses).
+ Usefull for creating simple terminal-based apps that require user input.
+ View `snake.jai` for an example.
+ It has been tested on the following terminal emulators:
+ - [GNOME Terminal](https://en.wikipedia.org/wiki/GNOME_Terminal)
+ - [kitty](https://en.wikipedia.org/wiki/Kitty_(terminal_emulator))
+ - [Konsole](https://en.wikipedia.org/wiki/Konsole)
+ - [Linux console](https://en.wikipedia.org/wiki/Linux_console)
+ - [xterm](https://en.wikipedia.org/wiki/Xterm)
+ - [Windows Terminal](https://en.wikipedia.org/wiki/Windows_Terminal)
+*/
+
#module_parameters(COLOR_MODE_BITS := 24);
@@ -32,11 +45,11 @@
#import "UTF8";
#load "key_map.jai";
-#add_context tui_style : Style; // This contains the last style applied by the module.
+#add_context tui_style : Style; // This contains the last style applied by the module.
#add_context tui_output_builder : *String_Builder; // If set, this will serve as an output buffer for this module procedures.
KEY_SIZE :: #run type_info(Key).runtime_size;
-#assert(input_buffer.count >= KEY_SIZE); // The input buffer size must be capable to hold an entire Key.
+#assert(input_buffer.count >= KEY_SIZE); // The input buffer size must be capable to hold an entire Key.
active := false;
input_override : Key;