mirror of
https://github.com/Drezil/imgui.git
synced 2024-12-17 21:56:36 +00:00
Remove CaptureInputCharactersFromApp and minor cleanups (#305)
This commit is contained in:
parent
73917115a8
commit
425c6cb3a3
@ -1903,9 +1903,9 @@ void ImGui::NewFrame()
|
||||
bool mouse_owned_by_application = mouse_earliest_button_down != -1 && !g.IO.MouseDownOwned[mouse_earliest_button_down];
|
||||
g.IO.WantCaptureMouse = (!mouse_owned_by_application && g.HoveredWindow != NULL) || (!mouse_owned_by_application && mouse_any_down) || (g.ActiveId != 0) || (!g.OpenedPopupStack.empty()) || (g.CaptureMouseNextFrame);
|
||||
g.IO.WantCaptureKeyboard = (g.ActiveId != 0) || (g.CaptureKeyboardNextFrame);
|
||||
g.IO.WantInputCharacters = ((g.InputTextState.Id != 0) && (g.InputTextState.Id == g.ActiveId)) || g.WantInputCharactersNextFrame;
|
||||
g.IO.WantInputCharacters = (g.ActiveId != 0 && g.InputTextState.Id == g.ActiveId);
|
||||
g.MouseCursor = ImGuiMouseCursor_Arrow;
|
||||
g.CaptureMouseNextFrame = g.CaptureKeyboardNextFrame = g.WantInputCharactersNextFrame = false;
|
||||
g.CaptureMouseNextFrame = g.CaptureKeyboardNextFrame = false;
|
||||
|
||||
// If mouse was first clicked outside of ImGui bounds we also cancel out hovering.
|
||||
if (mouse_owned_by_application)
|
||||
@ -2877,11 +2877,6 @@ void ImGui::CaptureMouseFromApp()
|
||||
GImGui->CaptureMouseNextFrame = true;
|
||||
}
|
||||
|
||||
void ImGui::CaptureInputCharactersFromApp()
|
||||
{
|
||||
GImGui->WantInputCharactersNextFrame = true;
|
||||
}
|
||||
|
||||
bool ImGui::IsItemHovered()
|
||||
{
|
||||
ImGuiWindow* window = GetCurrentWindow();
|
||||
|
1
imgui.h
1
imgui.h
@ -405,7 +405,6 @@ namespace ImGui
|
||||
IMGUI_API void SetMouseCursor(ImGuiMouseCursor type); // set desired cursor type
|
||||
IMGUI_API void CaptureKeyboardFromApp(); // manually enforce imgui setting the io.WantCaptureKeyboard flag next frame (your application needs to handle it). e.g. capture keyboard when your widget is being hovered.
|
||||
IMGUI_API void CaptureMouseFromApp(); // manually enforce imgui setting the io.WantCaptureMouse flag next frame (your application needs to handle it).
|
||||
IMGUI_API void CaptureInputCharactersFromApp(); // manually enforce imgui setting the io.WantInputCharacters flag next frame (your application needs to handle it).
|
||||
|
||||
// Helpers functions to access the MemAllocFn/MemFreeFn pointers in ImGui::GetIO()
|
||||
IMGUI_API void* MemAlloc(size_t sz);
|
||||
|
@ -394,7 +394,6 @@ struct ImGuiState
|
||||
float FramerateSecPerFrameAccum;
|
||||
bool CaptureMouseNextFrame; // explicit capture via CaptureInputs() sets those flags
|
||||
bool CaptureKeyboardNextFrame;
|
||||
bool WantInputCharactersNextFrame;
|
||||
char TempBuffer[1024*3+1]; // temporary text buffer
|
||||
|
||||
ImGuiState()
|
||||
@ -457,7 +456,7 @@ struct ImGuiState
|
||||
memset(FramerateSecPerFrame, 0, sizeof(FramerateSecPerFrame));
|
||||
FramerateSecPerFrameIdx = 0;
|
||||
FramerateSecPerFrameAccum = 0.0f;
|
||||
CaptureMouseNextFrame = CaptureKeyboardNextFrame = WantInputCharactersNextFrame = false;
|
||||
CaptureMouseNextFrame = CaptureKeyboardNextFrame = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user