Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions Source/ImGui/Private/SImGuiOverlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ class FImGuiInputProcessor : public IInputProcessor

ImGuiIO& IO = ImGui::GetIO();

IO.AddMouseSourceEvent(Event.IsTouchEvent() ? ImGuiMouseSource_TouchScreen : ImGuiMouseSource_Mouse);

if (SlateApp.HasAnyMouseCaptor())
{
IO.AddMousePosEvent(-FLT_MAX, -FLT_MAX);
Expand Down Expand Up @@ -185,6 +187,17 @@ class FImGuiInputProcessor : public IInputProcessor

ImGuiIO& IO = ImGui::GetIO();

if (Event.IsTouchEvent())
{
IO.AddMouseSourceEvent(ImGuiMouseSource_TouchScreen);
const FVector2f Position = Event.GetScreenSpacePosition();
IO.AddMousePosEvent(Position.X, Position.Y);
}
else
{
IO.AddMouseSourceEvent(ImGuiMouseSource_Mouse);
}

const FKey Button = Event.GetEffectingButton();
if (Button == EKeys::LeftMouseButton)
{
Expand Down Expand Up @@ -213,6 +226,8 @@ class FImGuiInputProcessor : public IInputProcessor

ImGuiIO& IO = ImGui::GetIO();

IO.AddMouseSourceEvent(Event.IsTouchEvent() ? ImGuiMouseSource_TouchScreen : ImGuiMouseSource_Mouse);

const FKey Button = Event.GetEffectingButton();
if (Button == EKeys::LeftMouseButton)
{
Expand Down