fixed N repetitions of movenment keys
This commit is contained in:
@@ -77,16 +77,15 @@ void user_interactions() {
|
|||||||
memset(input, 0, 255);
|
memset(input, 0, 255);
|
||||||
input_pass = 0;
|
input_pass = 0;
|
||||||
timeout(100); /* blocking timeout of getch() */
|
timeout(100); /* blocking timeout of getch() */
|
||||||
status |= STATUS_UPDATE_SCREEN_0;
|
|
||||||
}
|
}
|
||||||
binding_pass = 0;
|
binding_pass = 0;
|
||||||
status |= STATUS_UPDATE_SCREEN_0;
|
status |= STATUS_UPDATE_SCREEN_0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void (*func_ptr)(int, int);
|
void (*func_ptr)(int, int);
|
||||||
int number_length = 0;
|
unsigned long number_length = 0;
|
||||||
|
|
||||||
if (!binding_pass) {
|
if (!binding_pass) {
|
||||||
parsed_input_number = 0;
|
parsed_input_number = 0;
|
||||||
@@ -94,7 +93,6 @@ void user_interactions() {
|
|||||||
parsed_input_number = (parsed_input_number * 10) + (*input - '0');
|
parsed_input_number = (parsed_input_number * 10) + (*input - '0');
|
||||||
input++;
|
input++;
|
||||||
number_length++;
|
number_length++;
|
||||||
mvaddch(terminal_height-5, 5, number_length+48);
|
|
||||||
}
|
}
|
||||||
input -= number_length;
|
input -= number_length;
|
||||||
binding_pass = 1;
|
binding_pass = 1;
|
||||||
@@ -109,11 +107,7 @@ void user_interactions() {
|
|||||||
func_ptr = key_binding[i].func;
|
func_ptr = key_binding[i].func;
|
||||||
func_ptr(parsed_input_number, i);
|
func_ptr(parsed_input_number, i);
|
||||||
|
|
||||||
refresh();
|
} else if (strncmp(input + number_length, key_binding[i].key, cmp_len) == 0) {
|
||||||
curs_set(0);
|
|
||||||
refresh();
|
|
||||||
|
|
||||||
} else if (strncmp(input+number_length, key_binding[i].key, cmp_len) == 0) {
|
|
||||||
binding_matches++;
|
binding_matches++;
|
||||||
mvwprintw(stdscr, terminal_height-binding_matches-1, 0, "\t\t\t");
|
mvwprintw(stdscr, terminal_height-binding_matches-1, 0, "\t\t\t");
|
||||||
mvwprintw(stdscr, terminal_height-binding_matches-1, 0, "%s\t%s", key_binding[i].key, key_binding[i].comment);
|
mvwprintw(stdscr, terminal_height-binding_matches-1, 0, "%s\t%s", key_binding[i].key, key_binding[i].comment);
|
||||||
@@ -125,7 +119,7 @@ void user_interactions() {
|
|||||||
mvaddstr(terminal_height-binding_matches-2, 0, "input\tcommand\t\t");
|
mvaddstr(terminal_height-binding_matches-2, 0, "input\tcommand\t\t");
|
||||||
attroff(A_UNDERLINE);
|
attroff(A_UNDERLINE);
|
||||||
status &= ~STATUS_INPUT_MATCH;
|
status &= ~STATUS_INPUT_MATCH;
|
||||||
} else {
|
} else if (number_length != strlen(input)) {
|
||||||
memset(input, 0, 255);
|
memset(input, 0, 255);
|
||||||
input_pass = 0;
|
input_pass = 0;
|
||||||
binding_pass = 0;
|
binding_pass = 0;
|
||||||
|
Reference in New Issue
Block a user