|
|
@@ -908,7 +908,7 @@ int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const char*
|
|
|
if ((*str & 0xe0) == 0xc0)
|
|
|
{
|
|
|
*out_char = 0xFFFD; // will be invalid but not end of string
|
|
|
- if (in_text_end && in_text_end - (const char*)str < 2) return 0;
|
|
|
+ if (in_text_end && in_text_end - (const char*)str < 2) return 1;
|
|
|
if (*str < 0xc2) return 2;
|
|
|
c = (unsigned int)((*str++ & 0x1f) << 6);
|
|
|
if ((*str & 0xc0) != 0x80) return 2;
|
|
|
@@ -919,7 +919,7 @@ int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const char*
|
|
|
if ((*str & 0xf0) == 0xe0)
|
|
|
{
|
|
|
*out_char = 0xFFFD; // will be invalid but not end of string
|
|
|
- if (in_text_end && in_text_end - (const char*)str < 3) return 0;
|
|
|
+ if (in_text_end && in_text_end - (const char*)str < 3) return 1;
|
|
|
if (*str == 0xe0 && (str[1] < 0xa0 || str[1] > 0xbf)) return 3;
|
|
|
if (*str == 0xed && str[1] > 0x9f) return 3; // str[1] < 0x80 is checked below
|
|
|
c = (unsigned int)((*str++ & 0x0f) << 12);
|
|
|
@@ -933,7 +933,7 @@ int ImTextCharFromUtf8(unsigned int* out_char, const char* in_text, const char*
|
|
|
if ((*str & 0xf8) == 0xf0)
|
|
|
{
|
|
|
*out_char = 0xFFFD; // will be invalid but not end of string
|
|
|
- if (in_text_end && in_text_end - (const char*)str < 4) return 0;
|
|
|
+ if (in_text_end && in_text_end - (const char*)str < 4) return 1;
|
|
|
if (*str > 0xf4) return 4;
|
|
|
if (*str == 0xf0 && (str[1] < 0x90 || str[1] > 0xbf)) return 4;
|
|
|
if (*str == 0xf4 && str[1] > 0x8f) return 4; // str[1] < 0x80 is checked below
|
|
|
@@ -7217,7 +7217,8 @@ bool ImGui::InputTextEx(const char* label, char* buf, int buf_size, const ImVec2
|
|
|
if (g.IO.InputCharacters[0])
|
|
|
{
|
|
|
// Process text input (before we check for Return because using some IME will effectively send a Return?)
|
|
|
- if (!is_ctrl_down && is_editable)
|
|
|
+ // We ignore CTRL inputs, but need to allow CTRL+ALT as some keyboards (e.g. German) use AltGR - which is Alt+Ctrl - to input certain characters.
|
|
|
+ if (!(is_ctrl_down && !is_alt_down) && is_editable)
|
|
|
{
|
|
|
for (int n = 0; n < IM_ARRAYSIZE(g.IO.InputCharacters) && g.IO.InputCharacters[n]; n++)
|
|
|
if (unsigned int c = (unsigned int)g.IO.InputCharacters[n])
|