|
|
@ -1214,13 +1214,8 @@ void ImGuiIO::ClearInputCharacters()
|
|
|
|
InputQueueCharacters.resize(0);
|
|
|
|
InputQueueCharacters.resize(0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void ImGuiIO::AddFocusEvent(bool focused)
|
|
|
|
void ImGuiIO::ClearInputKeys()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (focused)
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Clear buttons state when focus is lost
|
|
|
|
|
|
|
|
// (this is useful so e.g. releasing Alt after focus loss on Alt-Tab doesn't trigger the Alt menu toggle)
|
|
|
|
|
|
|
|
memset(KeysDown, 0, sizeof(KeysDown));
|
|
|
|
memset(KeysDown, 0, sizeof(KeysDown));
|
|
|
|
for (int n = 0; n < IM_ARRAYSIZE(KeysDownDuration); n++)
|
|
|
|
for (int n = 0; n < IM_ARRAYSIZE(KeysDownDuration); n++)
|
|
|
|
KeysDownDuration[n] = KeysDownDurationPrev[n] = -1.0f;
|
|
|
|
KeysDownDuration[n] = KeysDownDurationPrev[n] = -1.0f;
|
|
|
@ -1230,6 +1225,13 @@ void ImGuiIO::AddFocusEvent(bool focused)
|
|
|
|
NavInputsDownDuration[n] = NavInputsDownDurationPrev[n] = -1.0f;
|
|
|
|
NavInputsDownDuration[n] = NavInputsDownDurationPrev[n] = -1.0f;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void ImGuiIO::AddFocusEvent(bool focused)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// We intentionally overwrite this and process in NewFrame(), in order to give a chance
|
|
|
|
|
|
|
|
// to multi-viewports backends to queue AddFocusEvent(false),AddFocusEvent(true) in same frame.
|
|
|
|
|
|
|
|
AppFocusLost = !focused;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// [SECTION] MISC HELPERS/UTILITIES (Geometry functions)
|
|
|
|
// [SECTION] MISC HELPERS/UTILITIES (Geometry functions)
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
@ -4187,6 +4189,14 @@ void ImGui::NewFrame()
|
|
|
|
g.DragDropWithinTarget = false;
|
|
|
|
g.DragDropWithinTarget = false;
|
|
|
|
g.DragDropHoldJustPressedId = 0;
|
|
|
|
g.DragDropHoldJustPressedId = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Clear buttons state when focus is lost
|
|
|
|
|
|
|
|
// (this is useful so e.g. releasing Alt after focus loss on Alt-Tab doesn't trigger the Alt menu toggle)
|
|
|
|
|
|
|
|
if (g.IO.AppFocusLost)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
g.IO.ClearInputKeys();
|
|
|
|
|
|
|
|
g.IO.AppFocusLost = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Update keyboard input state
|
|
|
|
// Update keyboard input state
|
|
|
|
// Synchronize io.KeyMods with individual modifiers io.KeyXXX bools
|
|
|
|
// Synchronize io.KeyMods with individual modifiers io.KeyXXX bools
|
|
|
|
g.IO.KeyMods = GetMergedKeyModFlags();
|
|
|
|
g.IO.KeyMods = GetMergedKeyModFlags();
|
|
|
|