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.jai18
1 files changed, 2 insertions, 16 deletions
diff --git a/modules/TUI/module.jai b/modules/TUI/module.jai
index bda326b..e7dc21a 100644
--- a/modules/TUI/module.jai
+++ b/modules/TUI/module.jai
@@ -14,6 +14,7 @@
#import "Basic";
#import "String";
#import "Thread";
+#import "UTF8";
#load "key_map.jai";
// Special Graphics Characters
@@ -289,21 +290,6 @@ set_next_key :: (key: Key) {
get_key :: (timeout_milliseconds: s32 = -1) -> Key {
assert_is_active();
- // BBBB BBBB & 1100 0000 == 10XX XXXX -> is continuation byte
- is_utf8_continuation_byte :: inline (byte: u8) -> bool {
- return (byte & 0xC0) == 0x80;
- }
-
- // BBBB BBBB & 1110 0000 == 110X XXXX -> 1 initial + 1 continuation byte
- // BBBB BBBB & 1111 0000 == 1110 XXXX -> 1 initial + 2 continuation byte
- // BBBB BBBB & 1111 1000 == 1111 0XXX -> 1 initial + 3 continuation byte
- count_utf8_bytes :: inline (byte: u8) -> int {
- if (byte & 0xE0) == 0xC0 return 1+1;
- if (byte & 0xF0) == 0xE0 return 1+2;
- if (byte & 0xF8) == 0xF0 return 1+3;
- return 1;
- }
-
if input_override != xx Keys.None {
defer input_override = xx Keys.None;
return input_override;
@@ -421,7 +407,7 @@ read_input :: (count_limit: int = -1, terminators: .. u8) -> string {
}
}
-read_input_line :: (count_limit: int, is_visible: bool = true) -> string, Key {
+read_input_line :: (count_limit: int, is_visible: bool = true, placeholder: string = "") -> string, Key {
/*
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.