IO: Input queue trickling adjustment for touch screens. (#2702, #4921)

+ amend two comments in imgui.h
This commit is contained in:
ocornut
2023-04-04 20:07:57 +02:00
parent f070497cbd
commit c9fe7ebc7b
3 changed files with 14 additions and 2 deletions

View File

@ -8733,6 +8733,8 @@ void ImGui::UpdateInputEvents(bool trickle_fast_inputs)
IM_ASSERT(button >= 0 && button < ImGuiMouseButton_COUNT);
if (trickle_fast_inputs && ((mouse_button_changed & (1 << button)) || mouse_wheeled))
break;
if (trickle_fast_inputs && e->MouseButton.MouseSource == ImGuiMouseSource_TouchScreen && mouse_moved) // #2702: TouchScreen have no initial hover.
break;
io.MouseDown[button] = e->MouseButton.Down;
io.MouseSource = e->MouseButton.MouseSource;
mouse_button_changed |= (1 << button);