aboutsummaryrefslogtreecommitdiff
path: root/modules/TUI/module.jai
diff options
context:
space:
mode:
authordam <dam@gudinoff>2024-05-18 01:30:01 +0100
committerdam <dam@gudinoff>2024-05-18 01:30:01 +0100
commitaf1317ed93f7d5fc16baceaadb0da17aa17591be (patch)
tree17b0878b430688da9f3481ac621f581d18cbf076 /modules/TUI/module.jai
parentbdea73c8349c2c918befad4120f49f9826d270dc (diff)
downloadtask-time-tracker-af1317ed93f7d5fc16baceaadb0da17aa17591be.tar.zst
task-time-tracker-af1317ed93f7d5fc16baceaadb0da17aa17591be.zip
Updated modules.
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;