fix double keystokes with SDL2

tested with both keyboard input and Virtual Keyboard

see http://pulkomandy.tk/projects/GrafX2/ticket/135
This commit is contained in:
Thomas Bernard 2019-06-09 20:06:03 +02:00
parent 41e25d2204
commit f35b659ce9
No known key found for this signature in database
GPG Key ID: 0FF11B67A5C0863C

View File

@ -1152,7 +1152,13 @@ byte Readline_ex_unicode(word x_pos, word y_pos, char * str, word * str_unicode,
} }
break; break;
default : default :
// SDL2 keystrokes are reported through both Key_Text and
// Key_ANSI / Key_UNICODE
#if defined(USE_SDL2)
if (use_virtual_keyboard && size<max_size && input_char != 0)
#else
if (size<max_size && input_char != 0) if (size<max_size && input_char != 0)
#endif
{ {
// Si la touche était autorisée... // Si la touche était autorisée...
byte is_authorized = Valid_character(input_char, input_type); byte is_authorized = Valid_character(input_char, input_type);