ui: updates TODO.md

This commit is contained in:
2026-05-13 18:26:39 +03:00
parent 42d72e2464
commit 95c8e56559
4 changed files with 12 additions and 6 deletions
+6 -3
View File
@@ -19,6 +19,7 @@ bool w_input_default_key_action(w_cb_args_t *args) {
wchar_t w_key[2];
app_t *app = args->app;
char long_key[3];
int short_val_len = 1;
switch (key) {
case KEY_BACKSPACE:
@@ -36,22 +37,24 @@ bool w_input_default_key_action(w_cb_args_t *args) {
default:
if (input->value_len == input->max_len) break;
long_key[0] = key;
input->value_len++;
if ((key & 0xC0) == 0xC0) {
long_key[1] = wgetch(app->win);
long_key[2] = '\0';
short_val_len++;
} else {
long_key[1] = '\0';
}
mbstowcs(w_key, (const char *)&long_key, 2);
if (input->cur_pos > 0) {
start_pos = input->value_len++ - input->cur_pos;
start_pos = input->value_len - input->cur_pos;
memmove(input->value + start_pos + 1, input->value + start_pos,
input->value_len - start_pos);
input->value[start_pos] = key;
strcpy(input->value + start_pos, long_key);
input->w_value[start_pos] = w_key[0];
} else {
input->value[input->value_len++] = key;
input->value[input->value_len] = '\0';
strcpy(input->value + input->value_len, long_key);
input->w_value[input->value_len - 1] = w_key[0];
input->w_value[input->value_len] = '\0';