mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
IO.WantInputCharacters -> WantTextInput (#305)
This commit is contained in:
parent
30461345aa
commit
0a11024459
@ -1912,7 +1912,7 @@ 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.ActiveId != 0 && g.InputTextState.Id == g.ActiveId);
|
||||
g.IO.WantTextInput = (g.ActiveId != 0 && g.InputTextState.Id == g.ActiveId);
|
||||
g.MouseCursor = ImGuiMouseCursor_Arrow;
|
||||
g.CaptureMouseNextFrame = g.CaptureKeyboardNextFrame = false;
|
||||
|
||||
|
2
imgui.h
2
imgui.h
@ -728,7 +728,7 @@ struct ImGuiIO
|
||||
|
||||
bool WantCaptureMouse; // Mouse is hovering a window or widget is active (= ImGui will use your mouse input)
|
||||
bool WantCaptureKeyboard; // Widget is active (= ImGui will use your keyboard input)
|
||||
bool WantInputCharacters; // Some text input widget is active, which will read input characters from the InputCharacters array.
|
||||
bool WantTextInput; // Some text input widget is active, which will read input characters from the InputCharacters array.
|
||||
float Framerate; // Framerate estimation, in frame per second. Rolling average estimation based on IO.DeltaTime over 120 frames
|
||||
int MetricsAllocs; // Number of active memory allocations
|
||||
int MetricsRenderVertices; // Vertices output during last call to Render()
|
||||
|
@ -1343,7 +1343,7 @@ void ImGui::ShowTestWindow(bool* opened)
|
||||
|
||||
ImGui::Text("WantCaptureMouse: %s", io.WantCaptureMouse ? "true" : "false");
|
||||
ImGui::Text("WantCaptureKeyboard: %s", io.WantCaptureKeyboard ? "true" : "false");
|
||||
ImGui::Text("WantInputCharacters: %s", io.WantInputCharacters ? "true" : "false");
|
||||
ImGui::Text("WantTextInput: %s", io.WantTextInput ? "true" : "false");
|
||||
|
||||
ImGui::Button("Hover me\nto enforce\ninputs capture");
|
||||
if (ImGui::IsItemHovered())
|
||||
|
Loading…
Reference in New Issue
Block a user