fixed N repetitions of movenment keys

This commit is contained in:
nova
2025-08-12 22:35:31 +02:00
parent 8b02e8e4e6
commit 37d82bebf8

View File

@@ -77,7 +77,6 @@ void user_interactions() {
memset(input, 0, 255);
input_pass = 0;
timeout(100); /* blocking timeout of getch() */
status |= STATUS_UPDATE_SCREEN_0;
}
binding_pass = 0;
status |= STATUS_UPDATE_SCREEN_0;
@@ -86,7 +85,7 @@ void user_interactions() {
void (*func_ptr)(int, int);
int number_length = 0;
unsigned long number_length = 0;
if (!binding_pass) {
parsed_input_number = 0;
@@ -94,7 +93,6 @@ void user_interactions() {
parsed_input_number = (parsed_input_number * 10) + (*input - '0');
input++;
number_length++;
mvaddch(terminal_height-5, 5, number_length+48);
}
input -= number_length;
binding_pass = 1;
@@ -109,10 +107,6 @@ void user_interactions() {
func_ptr = key_binding[i].func;
func_ptr(parsed_input_number, i);
refresh();
curs_set(0);
refresh();
} else if (strncmp(input + number_length, key_binding[i].key, cmp_len) == 0) {
binding_matches++;
mvwprintw(stdscr, terminal_height-binding_matches-1, 0, "\t\t\t");
@@ -125,7 +119,7 @@ void user_interactions() {
mvaddstr(terminal_height-binding_matches-2, 0, "input\tcommand\t\t");
attroff(A_UNDERLINE);
status &= ~STATUS_INPUT_MATCH;
} else {
} else if (number_length != strlen(input)) {
memset(input, 0, 255);
input_pass = 0;
binding_pass = 0;