View Issue Details

IDProjectCategoryView StatusLast Update
0002703NoesisGUIUnrealpublic2023-11-02 11:43
Reporterpaula.flamingfowl Assigned Tohcpizzi  
PrioritynormalSeverityfeature 
Status resolvedResolutionfixed 
Product Version3.2 
Target Version3.2.3Fixed in Version3.2.3 
Summary0002703: Mouse enhanced input actions not triggering
Description

We have a set of cards that are selected by clicking them, and should be deselected if we right click them or any part of the screen.
We are using the enhanced input system and we created a cancel card action (assigned to right click).

If we right click any part of the screen without noesis UI, it works correctly.
However, if we right click a part of the screen with some UI (for example on top of the cards or any other button), the enhanced input doesn't trigger.

While investigating this, we realized that if we change the NativeOnMouseButtonDown function return value when hit, the right click works but there are other issues with changing this

Steps To Reproduce

Create a UI with a button, import it and add it to the viewport.
Create an enhanced action assigned to right click. Assing the completed event to some print or log funtion
Right click outsite the button. This should work
Right click inside the button. The print/log won't appear

Attached Files
noesis.PNG (66,257 bytes)   
noesis.PNG (66,257 bytes)   
PlatformWindows

Activities

hcpizzi

hcpizzi

2023-10-25 12:37

developer   ~0008882

Hi Paula,

I think I've fixed the issue. We weren't taking into account whether the event was handled by Noesis or not. I've added that check and it fixes your repro case. Could you give this patch a try?

Thanks.

2703.patch (6,150 bytes)   
Index: NoesisInstance.cpp
@@ -1589,18 +1596,22 @@
 
 		if (IsGamepadSimulatedClick)
 		{
-			XamlView->KeyDown(Noesis::Key_GamepadAccept);
-			return FReply::Handled().PreventThrottling().CaptureMouse(MyWidget.Pin().ToSharedRef());
+			bool Handled = XamlView->KeyDown(Noesis::Key_GamepadAccept);
+
+			if (Handled)
+			{
+				return FReply::Handled().PreventThrottling().CaptureMouse(MyWidget.Pin().ToSharedRef());
+			}
 		}
 		else
 		{
 			FVector2D Position = MyGeometry.AbsoluteToLocal(MouseEvent.GetScreenSpacePosition()) * MyGeometry.Scale;
-			bool hit = HitTest(Position);
+			bool Hit = HitTest(Position);
 
 			Noesis::MouseButton MouseButton = GetNoesisMouseButton(MouseEvent.GetEffectingButton());
-			XamlView->MouseButtonDown(FPlatformMath::RoundToInt(Position.X), FPlatformMath::RoundToInt(Position.Y), MouseButton);
+			bool Handled = XamlView->MouseButtonDown(FPlatformMath::RoundToInt(Position.X), FPlatformMath::RoundToInt(Position.Y), MouseButton);
 
-			if (hit)
+			if (Handled && Hit)
 			{
 				return FReply::Handled().PreventThrottling();
 			}
@@ -1618,18 +1629,22 @@
 		if (IsGamepadSimulatedClick)
 		{
 			IsGamepadSimulatedClick = false;
-			XamlView->KeyUp(Noesis::Key_GamepadAccept);
-			return FReply::Handled().PreventThrottling();
+			bool Handled = XamlView->KeyUp(Noesis::Key_GamepadAccept);
+
+			if (Handled)
+			{
+				return FReply::Handled().PreventThrottling();
+			}
 		}
 		else
 		{
 			FVector2D Position = MyGeometry.AbsoluteToLocal(MouseEvent.GetScreenSpacePosition()) * MyGeometry.Scale;
-			bool hit = HitTest(Position);
+			bool Hit = HitTest(Position);
 
 			Noesis::MouseButton MouseButton = GetNoesisMouseButton(MouseEvent.GetEffectingButton());
-			XamlView->MouseButtonUp(FPlatformMath::RoundToInt(Position.X), FPlatformMath::RoundToInt(Position.Y), MouseButton);
+			bool Handled = XamlView->MouseButtonUp(FPlatformMath::RoundToInt(Position.X), FPlatformMath::RoundToInt(Position.Y), MouseButton);
 
-			if (hit)
+			if (Handled && Hit)
 			{
 				return FReply::Handled().PreventThrottling();
 			}
@@ -1645,11 +1660,11 @@
 	if (EnableMouse && XamlView && !MouseEvent.GetCursorDelta().IsZero()) // Ignore synthetic events that are messing with the tooltip code.
 	{
 		FVector2D Position = MyGeometry.AbsoluteToLocal(MouseEvent.GetScreenSpacePosition()) * MyGeometry.Scale;
-		bool hit = HitTest(Position);
+		bool Hit = HitTest(Position);
 
-		XamlView->MouseMove(FPlatformMath::RoundToInt(Position.X), FPlatformMath::RoundToInt(Position.Y));
+		bool Handled = XamlView->MouseMove(FPlatformMath::RoundToInt(Position.X), FPlatformMath::RoundToInt(Position.Y));
 
-		if (hit)
+		if (Handled && Hit)
 		{
 			return FReply::Handled().PreventThrottling();
 		}
@@ -1664,12 +1679,12 @@
 	if (EnableMouse && XamlView)
 	{
 		FVector2D Position = MyGeometry.AbsoluteToLocal(MouseEvent.GetScreenSpacePosition()) * MyGeometry.Scale;
-		bool hit = HitTest(Position);
+		bool Hit = HitTest(Position);
 
 		float WheelDelta = MouseEvent.GetWheelDelta();
-		XamlView->MouseWheel(FPlatformMath::RoundToInt(Position.X), FPlatformMath::RoundToInt(Position.Y), FPlatformMath::RoundToInt(WheelDelta * 120.f));
+		bool Handled = XamlView->MouseWheel(FPlatformMath::RoundToInt(Position.X), FPlatformMath::RoundToInt(Position.Y), FPlatformMath::RoundToInt(WheelDelta * 120.f));
 
-		if (hit)
+		if (Handled && Hit)
 		{
 			return FReply::Handled().PreventThrottling();
 		}
@@ -1684,12 +1699,12 @@
 	if (EnableTouch && XamlView)
 	{
 		FVector2D Position = MyGeometry.AbsoluteToLocal(TouchEvent.GetScreenSpacePosition()) * MyGeometry.Scale;
-		bool hit = HitTest(Position);
+		bool Hit = HitTest(Position);
 
 		uint32 PointerIndex = TouchEvent.GetPointerIndex();
-		XamlView->TouchDown(FPlatformMath::RoundToInt(Position.X), FPlatformMath::RoundToInt(Position.Y), PointerIndex);
+		bool Handled = XamlView->TouchDown(FPlatformMath::RoundToInt(Position.X), FPlatformMath::RoundToInt(Position.Y), PointerIndex);
 
-		if (hit)
+		if (Handled && Hit)
 		{
 			return FReply::Handled().PreventThrottling();
 		}
@@ -1704,12 +1719,12 @@
 	if (EnableTouch && XamlView)
 	{
 		FVector2D Position = MyGeometry.AbsoluteToLocal(TouchEvent.GetScreenSpacePosition()) * MyGeometry.Scale;
-		bool hit = HitTest(Position);
+		bool Hit = HitTest(Position);
 
 		uint32 PointerIndex = TouchEvent.GetPointerIndex();
-		XamlView->TouchMove(FPlatformMath::RoundToInt(Position.X), FPlatformMath::RoundToInt(Position.Y), PointerIndex);
+		bool Handled = XamlView->TouchMove(FPlatformMath::RoundToInt(Position.X), FPlatformMath::RoundToInt(Position.Y), PointerIndex);
 
-		if (hit)
+		if (Handled && Hit)
 		{
 			return FReply::Handled().PreventThrottling();
 		}
@@ -1724,12 +1739,12 @@
 	if (EnableTouch && XamlView)
 	{
 		FVector2D Position = MyGeometry.AbsoluteToLocal(TouchEvent.GetScreenSpacePosition()) * MyGeometry.Scale;
-		bool hit = HitTest(Position);
+		bool Hit = HitTest(Position);
 
 		uint32 PointerIndex = TouchEvent.GetPointerIndex();
-		XamlView->TouchUp(FPlatformMath::RoundToInt(Position.X), FPlatformMath::RoundToInt(Position.Y), PointerIndex);
+		bool Handled = XamlView->TouchUp(FPlatformMath::RoundToInt(Position.X), FPlatformMath::RoundToInt(Position.Y), PointerIndex);
 
-		if (hit)
+		if (Handled && Hit)
 		{
 			return FReply::Handled().PreventThrottling();
 		}
@@ -1749,12 +1764,12 @@
 	if (EnableMouse && XamlView)
 	{
 		FVector2D Position = MyGeometry.AbsoluteToLocal(MouseEvent.GetScreenSpacePosition()) * MyGeometry.Scale;
-		bool hit = HitTest(Position);
+		bool Hit = HitTest(Position);
 
 		Noesis::MouseButton MouseButton = GetNoesisMouseButton(MouseEvent.GetEffectingButton());
-		XamlView->MouseDoubleClick(FPlatformMath::RoundToInt(Position.X), FPlatformMath::RoundToInt(Position.Y), MouseButton);
+		bool Handled = XamlView->MouseDoubleClick(FPlatformMath::RoundToInt(Position.X), FPlatformMath::RoundToInt(Position.Y), MouseButton);
 
-		if (hit)
+		if (Handled && Hit)
 		{
 			return FReply::Handled().PreventThrottling();
 		}
2703.patch (6,150 bytes)   
paula.flamingfowl

paula.flamingfowl

2023-10-31 15:50

reporter   ~0008915

The patch works!!! thanks :)

Issue History

Date Modified Username Field Change
2023-09-27 13:01 paula.flamingfowl New Issue
2023-09-27 13:01 paula.flamingfowl Tag Attached: enhanced input
2023-09-27 13:01 paula.flamingfowl Tag Attached: Unreal
2023-09-27 13:01 paula.flamingfowl File Added: noesis.PNG
2023-09-27 13:01 paula.flamingfowl File Added: Video-detail-page (1).webm
2023-09-27 18:03 jsantos Assigned To => hcpizzi
2023-09-27 18:03 jsantos Status new => assigned
2023-09-27 18:03 jsantos Target Version => 3.2.2
2023-09-27 18:04 jsantos Target Version 3.2.2 => 3.2.3
2023-10-25 12:37 hcpizzi Note Added: 0008882
2023-10-25 12:37 hcpizzi File Added: 2703.patch
2023-10-25 12:37 hcpizzi Status assigned => feedback
2023-10-31 15:50 paula.flamingfowl Note Added: 0008915
2023-10-31 15:50 paula.flamingfowl Status feedback => assigned
2023-11-02 11:43 hcpizzi Status assigned => resolved
2023-11-02 11:43 hcpizzi Resolution open => fixed
2023-11-02 11:43 hcpizzi Fixed in Version => 3.2.3