|
@@ -7817,6 +7817,8 @@ int ImGui::GetKeyPressedAmount(ImGuiKey key, float repeat_delay, float repeat_ra
|
|
{
|
|
{
|
|
ImGuiContext& g = *GImGui;
|
|
ImGuiContext& g = *GImGui;
|
|
const ImGuiKeyData* key_data = GetKeyData(key);
|
|
const ImGuiKeyData* key_data = GetKeyData(key);
|
|
|
|
+ if (!key_data->Down) // In theory this should already be encoded as (DownDuration < 0.0f), but testing this facilitate eating mechanism (until we finish work on input ownership)
|
|
|
|
+ return 0;
|
|
const float t = key_data->DownDuration;
|
|
const float t = key_data->DownDuration;
|
|
return CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, repeat_delay, repeat_rate);
|
|
return CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, repeat_delay, repeat_rate);
|
|
}
|
|
}
|
|
@@ -7849,6 +7851,8 @@ bool ImGui::IsKeyPressed(ImGuiKey key, bool repeat)
|
|
bool ImGui::IsKeyPressedEx(ImGuiKey key, ImGuiInputFlags flags)
|
|
bool ImGui::IsKeyPressedEx(ImGuiKey key, ImGuiInputFlags flags)
|
|
{
|
|
{
|
|
const ImGuiKeyData* key_data = GetKeyData(key);
|
|
const ImGuiKeyData* key_data = GetKeyData(key);
|
|
|
|
+ if (!key_data->Down) // In theory this should already be encoded as (DownDuration < 0.0f), but testing this facilitate eating mechanism (until we finish work on input ownership)
|
|
|
|
+ return false;
|
|
const float t = key_data->DownDuration;
|
|
const float t = key_data->DownDuration;
|
|
if (t < 0.0f)
|
|
if (t < 0.0f)
|
|
return false;
|
|
return false;
|
|
@@ -7885,6 +7889,8 @@ bool ImGui::IsMouseClicked(ImGuiMouseButton button, bool repeat)
|
|
{
|
|
{
|
|
ImGuiContext& g = *GImGui;
|
|
ImGuiContext& g = *GImGui;
|
|
IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
|
|
IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
|
|
|
|
+ if (!g.IO.MouseDown[button]) // In theory this should already be encoded as (DownDuration < 0.0f), but testing this facilitate eating mechanism (until we finish work on input ownership)
|
|
|
|
+ return false;
|
|
const float t = g.IO.MouseDownDuration[button];
|
|
const float t = g.IO.MouseDownDuration[button];
|
|
if (t == 0.0f)
|
|
if (t == 0.0f)
|
|
return true;
|
|
return true;
|