Declare other structures as constexpr (#4995) + rename ImGuiInputEventType_Char to ImGuiInputEventType_Text for consistency with event structure.

This commit is contained in:
ocornut
2022-02-11 12:24:32 +01:00
parent 71f98dd056
commit 5854da10e6
3 changed files with 16 additions and 16 deletions

View File

@ -1180,7 +1180,7 @@ void ImGuiIO::AddInputCharacter(unsigned int c)
return;
ImGuiInputEvent e;
e.Type = ImGuiInputEventType_Char;
e.Type = ImGuiInputEventType_Text;
e.Source = ImGuiInputSource_Keyboard;
e.Text.Char = c;
g.InputEventsQueue.push_back(e);
@ -7882,7 +7882,7 @@ void ImGui::UpdateInputEvents(bool trickle_fast_inputs)
}
}
}
else if (e->Type == ImGuiInputEventType_Char)
else if (e->Type == ImGuiInputEventType_Text)
{
// Trickling Rule: Stop processing queued events if keys/mouse have been interacted with
if (trickle_fast_inputs && (key_changed || mouse_button_changed != 0 || mouse_moved || mouse_wheeled))