Fix F1 on/off toggle for ImGui overlay (all platforms), clean up keycode handling (mostly macOS/iOS)

This commit is contained in:
Stephen Saunders 2022-08-01 16:11:57 -04:00
parent 5c2aaaf693
commit 1b3fe76cdb
7 changed files with 106 additions and 70 deletions

View file

@ -596,7 +596,9 @@ public:
}
// Render imGui
imGui->drawFrame(drawCmdBuffers[i]);
if (UIOverlay.visible) {
imGui->drawFrame(drawCmdBuffers[i]);
}
vkCmdEndRenderPass(drawCmdBuffers[i]);
@ -748,8 +750,9 @@ public:
io.DeltaTime = frameTimer;
io.MousePos = ImVec2(mousePos.x, mousePos.y);
io.MouseDown[0] = mouseButtons.left;
io.MouseDown[1] = mouseButtons.right;
io.MouseDown[0] = mouseButtons.left && UIOverlay.visible;
io.MouseDown[1] = mouseButtons.right && UIOverlay.visible;
io.MouseDown[2] = mouseButtons.middle && UIOverlay.visible;
draw();
@ -765,7 +768,7 @@ public:
virtual void mouseMoved(double x, double y, bool &handled)
{
ImGuiIO& io = ImGui::GetIO();
handled = io.WantCaptureMouse;
handled = io.WantCaptureMouse && UIOverlay.visible;
}
};