mirror of
https://github.com/ocornut/imgui.git
synced 2026-01-14 00:34:18 +00:00
Split into CaptureKeyboardFromApp() / CaptureMouseFromApp()
This commit is contained in:
parent
77fad80e9f
commit
e0da1e0658
2 changed files with 10 additions and 5 deletions
12
imgui.cpp
12
imgui.cpp
|
|
@ -3007,10 +3007,14 @@ void ImGui::SetMouseCursor(ImGuiMouseCursor cursor_type)
|
|||
GImGui->MouseCursor = cursor_type;
|
||||
}
|
||||
|
||||
void ImGui::CaptureInputsFromApp(bool capture_mouse, bool capture_keyboard)
|
||||
void ImGui::CaptureKeyboardFromApp()
|
||||
{
|
||||
GImGui->CaptureMouseNextFrame |= capture_mouse;
|
||||
GImGui->CaptureKeyboardNextFrame |= capture_keyboard;
|
||||
GImGui->CaptureKeyboardNextFrame = true;
|
||||
}
|
||||
|
||||
void ImGui::CaptureMouseFromApp()
|
||||
{
|
||||
GImGui->CaptureMouseNextFrame = true;
|
||||
}
|
||||
|
||||
bool ImGui::IsItemHovered()
|
||||
|
|
@ -11869,7 +11873,7 @@ void ImGui::ShowTestWindow(bool* opened)
|
|||
|
||||
ImGui::Button("Hover me\nto enforce\ninputs capture");
|
||||
if (ImGui::IsItemHovered())
|
||||
ImGui::CaptureInputsFromApp();
|
||||
ImGui::CaptureKeyboardFromApp();
|
||||
|
||||
ImGui::TreePop();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue