diff --git a/input/keyboard_line.c b/input/keyboard_line.c index 845dfd05b6..d2a139b097 100644 --- a/input/keyboard_line.c +++ b/input/keyboard_line.c @@ -52,8 +52,12 @@ input_keyboard_line_t *input_keyboard_line_new(void *userdata, return state; } -bool input_keyboard_line_event(input_keyboard_line_t *state, uint32_t character) +bool input_keyboard_line_event(input_keyboard_line_t *state, uint32_t character, bool down) { + if (!down) + { + return false; + } // Treat extended chars as ? as we cannot support printable characters for unicode stuff. char c = character >= 128 ? '?' : character; if (c == '\r' || c == '\n') @@ -147,7 +151,7 @@ void input_keyboard_event(bool down, unsigned code, uint32_t character, uint16_t } else if (g_keyboard_line) { - if (input_keyboard_line_event(g_keyboard_line, character)) + if (input_keyboard_line_event(g_keyboard_line, character, down)) { // Line is complete, can free it now. input_keyboard_line_free(g_keyboard_line); diff --git a/input/keyboard_line.h b/input/keyboard_line.h index a01e0eb08e..598b261c18 100644 --- a/input/keyboard_line.h +++ b/input/keyboard_line.h @@ -37,7 +37,7 @@ input_keyboard_line_t *input_keyboard_line_new(void *userdata, input_keyboard_line_complete_t cb); // Called on every keyboard character event. -bool input_keyboard_line_event(input_keyboard_line_t *state, uint32_t character); +bool input_keyboard_line_event(input_keyboard_line_t *state, uint32_t character, bool down); // Returns pointer to string. The underlying buffer can be reallocated at any time (or be NULL), but the pointer to it remains constant throughout the objects lifetime. const char **input_keyboard_line_get_buffer(const input_keyboard_line_t *state);