From ac9e0033f39a9f2feaa024024a7c443d4e6df77f Mon Sep 17 00:00:00 2001 From: dam Date: Mon, 1 Jan 2024 19:15:55 +0000 Subject: Added some TODO items and fixed show_processing procedure. --- TUI/module.jai | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'TUI/module.jai') diff --git a/TUI/module.jai b/TUI/module.jai index 95ab8dc..8c1d7ed 100644 --- a/TUI/module.jai +++ b/TUI/module.jai @@ -542,7 +542,8 @@ get_key :: (timeout_milliseconds: s32 = -1) -> Key { return xx Keys.None; } -get_str :: (count_limit: int = -1) -> string { +// TODO Maybe rename!? Or replace with read_string... or read_input... or something else?! +get_string :: (count_limit: int = -1) -> string { assert_is_initialized(); if count_limit < 0 { @@ -565,6 +566,16 @@ get_str :: (count_limit: int = -1) -> string { } } +read_string :: (count_limit: int = -1) -> string, Key { + // TODO WIP FIXME WIP + /* + Use the get_key to read user input and show it on screen... should allow to move the cursor left and right and to delete/backspace. + Enter should be used to end the input. + Escape should discard the input returning an empty string and a Enter key. + Resize should discard the input returning an empty string and a Resize key. + */ +} + start :: () { if initialized == true return; @@ -658,7 +669,7 @@ get_terminal_size :: () -> rows: int, columns: int { flush_input(); write_string(Commands.QueryWindowSizeInChars); - input := get_str(64,, temporary_allocator); + input := get_string(64,, temporary_allocator); // Expected response format: \e[8;;t // where is the number of rows and of columns. @@ -699,7 +710,7 @@ get_cursor_position :: () -> row: int, column: int { flush_input(); write_string(Commands.QueryCursorPosition); - input := get_str(64,, temporary_allocator); + input := get_string(64,, temporary_allocator); // Expected response format: \e[;R // where is the number of rows and of columns. -- cgit v1.2.3