Fix readline for Win32 and SDL

This commit is contained in:
Thomas Bernard 2018-06-23 01:10:38 +02:00
parent 238d49ce35
commit 6aaef13a6b
2 changed files with 4 additions and 4 deletions

View File

@ -777,7 +777,7 @@ byte Readline_ex_unicode(word x_pos,word y_pos,char * str,word * str_unicode,byt
goto affichage;
}
} while(input_key==0
} while(input_key==0 && Key == 0
#if defined(USE_SDL2)
&& Key_Text[0] == '\0'
#endif
@ -848,7 +848,7 @@ byte Readline_ex_unicode(word x_pos,word y_pos,char * str,word * str_unicode,byt
}
else
#endif
switch (input_key)
switch (Key)
{
case KEY_DELETE : // Suppr.
if (position<size)
@ -956,7 +956,7 @@ byte Readline_ex_unicode(word x_pos,word y_pos,char * str,word * str_unicode,byt
break;
default :
#if !defined(USE_SDL2)
if (size<max_size)
if (size<max_size && input_key != 0)
{
// Si la touche était autorisée...
byte is_authorized = Valid_character(input_key, input_type);

View File

@ -164,7 +164,7 @@ static LRESULT CALLBACK Win32_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LP
default:
{
char msg[256];
snprintf(msg, sizeof(msg), "unknown Message : 0x%x", uMsg);
snprintf(msg, sizeof(msg), "unknown Message : 0x%04x wParam=%08x lParam=%08x", uMsg, wParam, lParam);
Warning(msg);
}
}