mirror of
https://github.com/ocornut/imgui.git
synced 2026-05-22 22:43:06 +08:00
IO: added ImGuiConfigFlags_NoKeyboard for consistency and convenience. (#4921)
# Conflicts: # imgui.h # imgui_demo.cpp
This commit is contained in:
+10
-3
@@ -462,19 +462,26 @@ void ImGui::ShowDemoWindow(bool* p_open)
|
||||
ImGui::CheckboxFlags("io.ConfigFlags: NavEnableSetMousePos", &io.ConfigFlags, ImGuiConfigFlags_NavEnableSetMousePos);
|
||||
ImGui::SameLine(); HelpMarker("Instruct navigation to move the mouse cursor. See comment for ImGuiConfigFlags_NavEnableSetMousePos.");
|
||||
ImGui::CheckboxFlags("io.ConfigFlags: NoMouse", &io.ConfigFlags, ImGuiConfigFlags_NoMouse);
|
||||
ImGui::SameLine(); HelpMarker("Instruct dear imgui to disable mouse inputs and interactions.");
|
||||
|
||||
// The "NoMouse" option can get us stuck with a disabled mouse! Let's provide an alternative way to fix it:
|
||||
if (io.ConfigFlags & ImGuiConfigFlags_NoMouse)
|
||||
{
|
||||
// The "NoMouse" option can get us stuck with a disabled mouse! Let's provide an alternative way to fix it:
|
||||
if (fmodf((float)ImGui::GetTime(), 0.40f) < 0.20f)
|
||||
{
|
||||
ImGui::SameLine();
|
||||
ImGui::Text("<<PRESS SPACE TO DISABLE>>");
|
||||
}
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_Space))
|
||||
// Prevent both being checked
|
||||
if (ImGui::IsKeyPressed(ImGuiKey_Space) || (io.ConfigFlags & ImGuiConfigFlags_NoKeyboard))
|
||||
io.ConfigFlags &= ~ImGuiConfigFlags_NoMouse;
|
||||
}
|
||||
ImGui::CheckboxFlags("io.ConfigFlags: NoMouseCursorChange", &io.ConfigFlags, ImGuiConfigFlags_NoMouseCursorChange);
|
||||
|
||||
ImGui::CheckboxFlags("io.ConfigFlags: NoMouseCursorChange", &io.ConfigFlags, ImGuiConfigFlags_NoMouseCursorChange);
|
||||
ImGui::SameLine(); HelpMarker("Instruct backend to not alter mouse cursor shape and visibility.");
|
||||
ImGui::CheckboxFlags("io.ConfigFlags: NoKeyboard", &io.ConfigFlags, ImGuiConfigFlags_NoKeyboard);
|
||||
ImGui::SameLine(); HelpMarker("Instruct dear imgui to disable keyboard inputs and interactions.");
|
||||
|
||||
ImGui::Checkbox("io.ConfigInputTrickleEventQueue", &io.ConfigInputTrickleEventQueue);
|
||||
ImGui::SameLine(); HelpMarker("Enable input queue trickling: some types of events submitted during the same frame (e.g. button down + up) will be spread over multiple frames, improving interactions with low framerates.");
|
||||
ImGui::Checkbox("io.MouseDrawCursor", &io.MouseDrawCursor);
|
||||
|
||||
Reference in New Issue
Block a user