Index: Source/NoesisEditor/Private/NoesisBlueprintCompilerContext.cpp
===================================================================
--- Source/NoesisEditor/Private/NoesisBlueprintCompilerContext.cpp	(revision 14283)
+++ Source/NoesisEditor/Private/NoesisBlueprintCompilerContext.cpp	(revision 14284)
@@ -60,6 +60,7 @@
 		DefaultInstance->EnableKeyboard = NoesisBlueprint->EnableKeyboard;
 		DefaultInstance->EnableMouse = NoesisBlueprint->EnableMouse;
 		DefaultInstance->EmulateTouch = NoesisBlueprint->EmulateTouch;
+		DefaultInstance->SetUserFocusToViewport = NoesisBlueprint->SetUserFocusToViewport;
 		DefaultInstance->EnableTouch = NoesisBlueprint->EnableTouch;
 		DefaultInstance->EnableActions = NoesisBlueprint->EnableActions;
 		DefaultInstance->PixelDepthBias = NoesisBlueprint->PixelDepthBias;
Index: Source/NoesisRuntime/Classes/NoesisBlueprint.h
===================================================================
--- Source/NoesisRuntime/Classes/NoesisBlueprint.h	(revision 14283)
+++ Source/NoesisRuntime/Classes/NoesisBlueprint.h	(revision 14284)
@@ -56,6 +56,10 @@
 	UPROPERTY(EditAnywhere, Category = "Noesis View", meta = (EditCondition = "EnableMouse"))
 	bool EmulateTouch;
 
+	/** Handled mouse events set user focus to the game viewport. */
+	UPROPERTY(EditAnywhere, Category = "Noesis View", meta = (EditCondition = "EnableMouse"))
+	bool SetUserFocusToViewport;
+
 	UPROPERTY(EditAnywhere, Category = "Noesis View")
 	bool EnableTouch;
 
Index: Source/NoesisRuntime/Classes/NoesisInstance.h
===================================================================
--- Source/NoesisRuntime/Classes/NoesisInstance.h	(revision 14283)
+++ Source/NoesisRuntime/Classes/NoesisInstance.h	(revision 14284)
@@ -165,6 +165,9 @@
 	bool EmulateTouch;
 
 	UPROPERTY(BlueprintReadWrite, Category = "NoesisGUI")
+	bool SetUserFocusToViewport;
+
+	UPROPERTY(BlueprintReadWrite, Category = "NoesisGUI")
 	bool EnableTouch;
 
 	UPROPERTY(BlueprintReadWrite, Category = "NoesisGUI")
@@ -216,6 +219,7 @@
 	void OnPreviewLostKeyboardFocus(Noesis::BaseComponent* Component, const Noesis::KeyboardFocusChangedEventArgs& Args);
 
 	bool HitTest(FVector2D Position) const;
+	bool HasMouseCapture() const;
 
 	void TermInstance();
 
@@ -264,6 +268,8 @@
 	virtual FReply NativeOnTouchEnded(const FGeometry& MyGeometry, const FPointerEvent& InTouchEvent) override;
 	virtual FCursorReply NativeOnCursorQuery(const FGeometry& MyGeometry, const FPointerEvent& CursorEvent) override;
 	virtual FReply NativeOnMouseButtonDoubleClick(const FGeometry& MyGeometry, const FPointerEvent& MouseEvent) override;
+	virtual void NativeOnMouseEnter(const FGeometry& InGeometry, const FPointerEvent& InMouseEvent) override;
+	virtual void NativeOnMouseLeave(const FPointerEvent& InMouseEvent) override;
 	virtual bool NativeSupportsKeyboardFocus() const override;
 	virtual void NativeConstruct() override;
 	virtual void NativeDestruct() override;
Index: Source/NoesisRuntime/Private/NoesisBlueprint.cpp
===================================================================
--- Source/NoesisRuntime/Private/NoesisBlueprint.cpp	(revision 14283)
+++ Source/NoesisRuntime/Private/NoesisBlueprint.cpp	(revision 14284)
@@ -18,6 +18,7 @@
 	EnableKeyboard = true;
 	EnableMouse = true;
 	EmulateTouch = false;
+	SetUserFocusToViewport = false;
 	EnableTouch = true;
 	EnableActions = false;
 	PixelDepthBias = -1.0f;
Index: Source/NoesisRuntime/Private/NoesisInstance.cpp
===================================================================
--- Source/NoesisRuntime/Private/NoesisInstance.cpp	(revision 14283)
+++ Source/NoesisRuntime/Private/NoesisInstance.cpp	(revision 14284)
@@ -526,6 +526,7 @@
 	EnableKeyboard = true;
 	EnableMouse = true;
 	EmulateTouch = false;
+	SetUserFocusToViewport = false;
 	EnableTouch = true;
 	EnableActions = false;
 	PixelDepthBias = -1.0f;
@@ -1162,6 +1163,18 @@
 	return HitTester.Hit != nullptr;
 }
 
+bool UNoesisInstance::HasMouseCapture() const
+{
+	if (XamlView)
+	{
+		auto Root = XamlView->GetContent();
+		auto Mouse = Root != nullptr ? Root->GetMouse() : nullptr;
+		return Mouse != nullptr && Mouse->GetCaptured() != nullptr;
+	}
+
+	return false;
+}
+
 void UNoesisInstance::TermInstance()
 {
 	if (XamlView)
@@ -1465,10 +1478,15 @@
 	{
 		TCHAR Character = CharacterEvent.GetCharacter();
 
-		XamlView->Char(CharCast<char>(Character));
+		bool Handled = XamlView->Char(CharCast<char>(Character));
+
+		if (Handled)
+		{
+			return FReply::Handled();
+		}
 	}
 
-	return Super::NativeOnKeyChar(MyGeometry, CharacterEvent);
+	return FReply::Unhandled();
 }
 
 static TMap<FKey, Noesis::Key> InitKeyMap()
@@ -1595,11 +1613,16 @@
 		Noesis::Key* NoesisKey = KeyToNoesisKey(Key);
 		if (NoesisKey != nullptr)
 		{
-			XamlView->KeyDown(*NoesisKey);
+			bool Handled = XamlView->KeyDown(*NoesisKey);
+
+			if (Handled)
+			{
+				return FReply::Handled();
+			}
 		}
 	}
 
-	return Super::NativeOnKeyDown(MyGeometry, KeyEvent);
+	return FReply::Unhandled();
 }
 
 FReply UNoesisInstance::NativeOnKeyUp(const FGeometry& MyGeometry, const FKeyEvent& KeyEvent)
@@ -1611,31 +1634,20 @@
 		Noesis::Key* NoesisKey = KeyToNoesisKey(Key);
 		if (NoesisKey != nullptr)
 		{
-			XamlView->KeyUp(*NoesisKey);
+			bool Handled = XamlView->KeyUp(*NoesisKey);
+
+			if (Handled)
+			{
+				return FReply::Handled();
+			}
 		}
 	}
 
-	return Super::NativeOnKeyUp(MyGeometry, KeyEvent);
+	return FReply::Unhandled();
 }
 
 FReply UNoesisInstance::NativeOnAnalogValueChanged(const FGeometry& MyGeometry, const FAnalogInputEvent& InAnalogEvent)
 {
-	SCOPE_CYCLE_COUNTER(STAT_NoesisInstance_OnAnalogValueChanged);
-	if (XamlView)
-	{
-		if (FMath::Abs(InAnalogEvent.GetAnalogValue()) > 0.25f)
-		{
-			if (InAnalogEvent.GetKey() == EKeys::Gamepad_RightX)
-			{
-				XamlView->HScroll(InAnalogEvent.GetAnalogValue());
-			}
-			else if (InAnalogEvent.GetKey() == EKeys::Gamepad_RightY)
-			{
-				XamlView->Scroll(InAnalogEvent.GetAnalogValue());
-			}
-		}
-	}
-
 	return Super::NativeOnAnalogValueChanged(MyGeometry, InAnalogEvent);
 }
 
@@ -1670,7 +1682,7 @@
 
 			if (Handled)
 			{
-				return FReply::Handled().PreventThrottling().CaptureMouse(MyWidget.Pin().ToSharedRef());
+				return FReply::Handled().PreventThrottling().CaptureMouse(TakeWidget());
 			}
 		}
 		else
@@ -1679,11 +1691,24 @@
 			bool Hit = HitTest(Position);
 
 			Noesis::MouseButton MouseButton = GetNoesisMouseButton(MouseEvent.GetEffectingButton());
-			bool Handled = XamlView->MouseButtonDown(FPlatformMath::RoundToInt(Position.X), FPlatformMath::RoundToInt(Position.Y), MouseButton);
+			bool Handled = XamlView->MouseButtonDown(FPlatformMath::RoundToInt(Position.X), FPlatformMath::RoundToInt(Position.Y), MouseButton) || HasMouseCapture();
 
 			if (Handled && Hit)
 			{
-				return FReply::Handled().PreventThrottling();
+				auto Reply = FReply::Handled().PreventThrottling();
+				if (SetUserFocusToViewport)
+				{
+					Reply.SetUserFocus(FSlateApplication::Get().GetGameViewport().ToSharedRef());
+				}
+				if (HasMouseCapture())
+				{
+					Reply.CaptureMouse(TakeWidget());
+				}
+				else
+				{
+					Reply.ReleaseMouseCapture();
+				}
+				return Reply;
 			}
 		}
 	}
@@ -1712,11 +1737,24 @@
 			bool Hit = HitTest(Position);
 
 			Noesis::MouseButton MouseButton = GetNoesisMouseButton(MouseEvent.GetEffectingButton());
-			bool Handled = XamlView->MouseButtonUp(FPlatformMath::RoundToInt(Position.X), FPlatformMath::RoundToInt(Position.Y), MouseButton);
+			bool Handled = XamlView->MouseButtonUp(FPlatformMath::RoundToInt(Position.X), FPlatformMath::RoundToInt(Position.Y), MouseButton) || HasMouseCapture();
 
 			if (Handled && Hit)
 			{
-				return FReply::Handled().PreventThrottling();
+				auto Reply = FReply::Handled().PreventThrottling();
+				if (SetUserFocusToViewport)
+				{
+					Reply.SetUserFocus(FSlateApplication::Get().GetGameViewport().ToSharedRef());
+				}
+				if (HasMouseCapture())
+				{
+					Reply.CaptureMouse(TakeWidget());
+				}
+				else
+				{
+					Reply.ReleaseMouseCapture();
+				}
+				return Reply;
 			}
 		}
 	}
@@ -1732,11 +1770,24 @@
 		FVector2D Position = MyGeometry.AbsoluteToLocal(MouseEvent.GetScreenSpacePosition()) * MyGeometry.Scale;
 		bool Hit = HitTest(Position);
 
-		bool Handled = XamlView->MouseMove(FPlatformMath::RoundToInt(Position.X), FPlatformMath::RoundToInt(Position.Y));
+		bool Handled = XamlView->MouseMove(FPlatformMath::RoundToInt(Position.X), FPlatformMath::RoundToInt(Position.Y)) || HasMouseCapture();
 
 		if (Handled && Hit)
 		{
-			return FReply::Handled().PreventThrottling();
+			auto Reply = FReply::Handled().PreventThrottling();
+			if (SetUserFocusToViewport)
+			{
+				Reply.SetUserFocus(FSlateApplication::Get().GetGameViewport().ToSharedRef());
+			}
+			if (HasMouseCapture())
+			{
+				Reply.CaptureMouse(TakeWidget());
+			}
+			else
+			{
+				Reply.ReleaseMouseCapture();
+			}
+			return Reply;
 		}
 	}
 
@@ -1756,7 +1807,16 @@
 
 		if (Handled && Hit)
 		{
-			return FReply::Handled().PreventThrottling();
+			auto Reply = FReply::Handled().PreventThrottling();
+			if (HasMouseCapture())
+			{
+				Reply.CaptureMouse(TakeWidget());
+			}
+			else
+			{
+				Reply.ReleaseMouseCapture();
+			}
+			return Reply;
 		}
 	}
 
@@ -1776,7 +1836,16 @@
 
 		if (Handled && Hit)
 		{
-			return FReply::Handled().PreventThrottling();
+			auto Reply = FReply::Handled().PreventThrottling();
+			if (HasMouseCapture())
+			{
+				Reply.CaptureMouse(TakeWidget());
+			}
+			else
+			{
+				Reply.ReleaseMouseCapture();
+			}
+			return Reply;
 		}
 	}
 
@@ -1796,7 +1865,16 @@
 
 		if (Handled && Hit)
 		{
-			return FReply::Handled().PreventThrottling();
+			auto Reply = FReply::Handled().PreventThrottling();
+			if (HasMouseCapture())
+			{
+				Reply.CaptureMouse(TakeWidget());
+			}
+			else
+			{
+				Reply.ReleaseMouseCapture();
+			}
+			return Reply;
 		}
 	}
 
@@ -1816,7 +1894,16 @@
 
 		if (Handled && Hit)
 		{
-			return FReply::Handled().PreventThrottling();
+			auto Reply = FReply::Handled().PreventThrottling();
+			if (HasMouseCapture())
+			{
+				Reply.CaptureMouse(TakeWidget());
+			}
+			else
+			{
+				Reply.ReleaseMouseCapture();
+			}
+			return Reply;
 		}
 	}
 
@@ -1841,7 +1928,16 @@
 
 		if (Handled && Hit)
 		{
-			return FReply::Handled().PreventThrottling();
+			auto Reply = FReply::Handled().PreventThrottling();
+			if (HasMouseCapture())
+			{
+				Reply.CaptureMouse(TakeWidget());
+			}
+			else
+			{
+				Reply.ReleaseMouseCapture();
+			}
+			return Reply;
 		}
 	}
 
@@ -1848,6 +1944,22 @@
 	return FReply::Unhandled();
 }
 
+void UNoesisInstance::NativeOnMouseEnter(const FGeometry& InGeometry, const FPointerEvent& InMouseEvent)
+{
+	if (XamlView)
+	{
+		XamlView->Activate();
+	}
+}
+
+void UNoesisInstance::NativeOnMouseLeave(const FPointerEvent& InMouseEvent)
+{
+	if (XamlView && !HasMouseCapture())
+	{
+		XamlView->Deactivate();
+	}
+}
+
 bool UNoesisInstance::NativeSupportsKeyboardFocus() const
 {
 	// SObjectWidget::OnKeyDown calls UNoesisInstance::NativeOnKeyDown. There we set SupportsKeyboardFocus = !EnableActions.
