Renamed CaptureMouseFromApp() and CaptureKeyboardFromApp() to SetNextFrameWantCaptureMouse() and SetNextFrameWantCaptureKeyboard(). Added demo. (#5304, #4831, #4480, #533)

This commit is contained in:
ocornut
2022-05-23 11:22:46 +02:00
parent cb56b0b238
commit 7bf07d2526
5 changed files with 48 additions and 19 deletions

View File

@ -7767,16 +7767,16 @@ void ImGui::SetMouseCursor(ImGuiMouseCursor cursor_type)
g.MouseCursor = cursor_type;
}
void ImGui::CaptureKeyboardFromApp(bool capture)
void ImGui::SetNextFrameWantCaptureKeyboard(bool want_capture_keyboard)
{
ImGuiContext& g = *GImGui;
g.WantCaptureKeyboardNextFrame = capture ? 1 : 0;
g.WantCaptureKeyboardNextFrame = want_capture_keyboard ? 1 : 0;
}
void ImGui::CaptureMouseFromApp(bool capture)
void ImGui::SetNextFrameWantCaptureMouse(bool want_capture_mouse)
{
ImGuiContext& g = *GImGui;
g.WantCaptureMouseNextFrame = capture ? 1 : 0;
g.WantCaptureMouseNextFrame = want_capture_mouse ? 1 : 0;
}
static const char* GetInputSourceName(ImGuiInputSource source)