|
@@ -7735,14 +7735,14 @@ int ImGui::CalcTypematicRepeatAmount(float t0, float t1, float repeat_delay, flo
|
|
return count;
|
|
return count;
|
|
}
|
|
}
|
|
|
|
|
|
-void ImGui::GetTypematicRepeatRate(ImGuiInputReadFlags flags, float* repeat_delay, float* repeat_rate)
|
|
|
|
|
|
+void ImGui::GetTypematicRepeatRate(ImGuiInputFlags flags, float* repeat_delay, float* repeat_rate)
|
|
{
|
|
{
|
|
ImGuiContext& g = *GImGui;
|
|
ImGuiContext& g = *GImGui;
|
|
- switch (flags & ImGuiInputReadFlags_RepeatRateMask_)
|
|
|
|
|
|
+ switch (flags & ImGuiInputFlags_RepeatRateMask_)
|
|
{
|
|
{
|
|
- case ImGuiInputReadFlags_RepeatRateNavMove: *repeat_delay = g.IO.KeyRepeatDelay * 0.72f; *repeat_rate = g.IO.KeyRepeatRate * 0.80f; return;
|
|
|
|
- case ImGuiInputReadFlags_RepeatRateNavTweak: *repeat_delay = g.IO.KeyRepeatDelay * 0.72f; *repeat_rate = g.IO.KeyRepeatRate * 0.30f; return;
|
|
|
|
- case ImGuiInputReadFlags_RepeatRateDefault: default: *repeat_delay = g.IO.KeyRepeatDelay * 1.00f; *repeat_rate = g.IO.KeyRepeatRate * 1.00f; return;
|
|
|
|
|
|
+ case ImGuiInputFlags_RepeatRateNavMove: *repeat_delay = g.IO.KeyRepeatDelay * 0.72f; *repeat_rate = g.IO.KeyRepeatRate * 0.80f; return;
|
|
|
|
+ case ImGuiInputFlags_RepeatRateNavTweak: *repeat_delay = g.IO.KeyRepeatDelay * 0.72f; *repeat_rate = g.IO.KeyRepeatRate * 0.30f; return;
|
|
|
|
+ case ImGuiInputFlags_RepeatRateDefault: default: *repeat_delay = g.IO.KeyRepeatDelay * 1.00f; *repeat_rate = g.IO.KeyRepeatRate * 1.00f; return;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -7776,12 +7776,12 @@ bool ImGui::IsKeyDown(ImGuiKey key)
|
|
|
|
|
|
bool ImGui::IsKeyPressed(ImGuiKey key, bool repeat)
|
|
bool ImGui::IsKeyPressed(ImGuiKey key, bool repeat)
|
|
{
|
|
{
|
|
- return IsKeyPressedEx(key, repeat ? ImGuiInputReadFlags_Repeat : ImGuiInputReadFlags_None);
|
|
|
|
|
|
+ return IsKeyPressedEx(key, repeat ? ImGuiInputFlags_Repeat : ImGuiInputFlags_None);
|
|
}
|
|
}
|
|
|
|
|
|
// Important: unlike legacy IsKeyPressed(ImGuiKey, bool repeat=true) which DEFAULT to repeat, this requires EXPLICIT repeat.
|
|
// Important: unlike legacy IsKeyPressed(ImGuiKey, bool repeat=true) which DEFAULT to repeat, this requires EXPLICIT repeat.
|
|
// [Internal] 2022/07: Do not call this directly! It is a temporary entry point which we will soon replace with an overload for IsKeyPressed() when we introduce key ownership.
|
|
// [Internal] 2022/07: Do not call this directly! It is a temporary entry point which we will soon replace with an overload for IsKeyPressed() when we introduce key ownership.
|
|
-bool ImGui::IsKeyPressedEx(ImGuiKey key, ImGuiInputReadFlags flags)
|
|
|
|
|
|
+bool ImGui::IsKeyPressedEx(ImGuiKey key, ImGuiInputFlags flags)
|
|
{
|
|
{
|
|
const ImGuiKeyData* key_data = GetKeyData(key);
|
|
const ImGuiKeyData* key_data = GetKeyData(key);
|
|
const float t = key_data->DownDuration;
|
|
const float t = key_data->DownDuration;
|
|
@@ -7789,7 +7789,7 @@ bool ImGui::IsKeyPressedEx(ImGuiKey key, ImGuiInputReadFlags flags)
|
|
return false;
|
|
return false;
|
|
|
|
|
|
bool pressed = (t == 0.0f);
|
|
bool pressed = (t == 0.0f);
|
|
- if (!pressed && ((flags & ImGuiInputReadFlags_Repeat) != 0))
|
|
|
|
|
|
+ if (!pressed && ((flags & ImGuiInputFlags_Repeat) != 0))
|
|
{
|
|
{
|
|
float repeat_delay, repeat_rate;
|
|
float repeat_delay, repeat_rate;
|
|
GetTypematicRepeatRate(flags, &repeat_delay, &repeat_rate);
|
|
GetTypematicRepeatRate(flags, &repeat_delay, &repeat_rate);
|
|
@@ -10225,7 +10225,7 @@ float ImGui::GetNavTweakPressedAmount(ImGuiAxis axis)
|
|
{
|
|
{
|
|
ImGuiContext& g = *GImGui;
|
|
ImGuiContext& g = *GImGui;
|
|
float repeat_delay, repeat_rate;
|
|
float repeat_delay, repeat_rate;
|
|
- GetTypematicRepeatRate(ImGuiInputReadFlags_RepeatRateNavTweak, &repeat_delay, &repeat_rate);
|
|
|
|
|
|
+ GetTypematicRepeatRate(ImGuiInputFlags_RepeatRateNavTweak, &repeat_delay, &repeat_rate);
|
|
|
|
|
|
ImGuiKey key_less, key_more;
|
|
ImGuiKey key_less, key_more;
|
|
if (g.NavInputSource == ImGuiInputSource_Gamepad)
|
|
if (g.NavInputSource == ImGuiInputSource_Gamepad)
|
|
@@ -10444,7 +10444,7 @@ void ImGui::NavUpdateCreateMoveRequest()
|
|
g.NavMoveScrollFlags = ImGuiScrollFlags_None;
|
|
g.NavMoveScrollFlags = ImGuiScrollFlags_None;
|
|
if (window && !g.NavWindowingTarget && !(window->Flags & ImGuiWindowFlags_NoNavInputs))
|
|
if (window && !g.NavWindowingTarget && !(window->Flags & ImGuiWindowFlags_NoNavInputs))
|
|
{
|
|
{
|
|
- const ImGuiInputReadFlags repeat_mode = ImGuiInputReadFlags_Repeat | ImGuiInputReadFlags_RepeatRateNavMove;
|
|
|
|
|
|
+ const ImGuiInputFlags repeat_mode = ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateNavMove;
|
|
if (!IsActiveIdUsingNavDir(ImGuiDir_Left) && (IsKeyPressedEx(ImGuiKey_GamepadDpadLeft, repeat_mode) || IsKeyPressedEx(ImGuiKey_LeftArrow, repeat_mode))) { g.NavMoveDir = ImGuiDir_Left; }
|
|
if (!IsActiveIdUsingNavDir(ImGuiDir_Left) && (IsKeyPressedEx(ImGuiKey_GamepadDpadLeft, repeat_mode) || IsKeyPressedEx(ImGuiKey_LeftArrow, repeat_mode))) { g.NavMoveDir = ImGuiDir_Left; }
|
|
if (!IsActiveIdUsingNavDir(ImGuiDir_Right) && (IsKeyPressedEx(ImGuiKey_GamepadDpadRight, repeat_mode) || IsKeyPressedEx(ImGuiKey_RightArrow, repeat_mode))) { g.NavMoveDir = ImGuiDir_Right; }
|
|
if (!IsActiveIdUsingNavDir(ImGuiDir_Right) && (IsKeyPressedEx(ImGuiKey_GamepadDpadRight, repeat_mode) || IsKeyPressedEx(ImGuiKey_RightArrow, repeat_mode))) { g.NavMoveDir = ImGuiDir_Right; }
|
|
if (!IsActiveIdUsingNavDir(ImGuiDir_Up) && (IsKeyPressedEx(ImGuiKey_GamepadDpadUp, repeat_mode) || IsKeyPressedEx(ImGuiKey_UpArrow, repeat_mode))) { g.NavMoveDir = ImGuiDir_Up; }
|
|
if (!IsActiveIdUsingNavDir(ImGuiDir_Up) && (IsKeyPressedEx(ImGuiKey_GamepadDpadUp, repeat_mode) || IsKeyPressedEx(ImGuiKey_UpArrow, repeat_mode))) { g.NavMoveDir = ImGuiDir_Up; }
|