# SWidget::OnMouseButtonUp triggers only on double click

**URL:** <https://forums.unrealengine.com/t/swidget-onmousebuttonup-triggers-only-on-double-click/334846>\
**Category:** UI\
**Tags:** unreal-engine, mouse-event, Widget, question\
**Created:** [October 10, 2015, 8:47am UTC](https://forums.unrealengine.com/t/swidget-onmousebuttonup-triggers-only-on-double-click/334846 "2015-10-10T08:47:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![uced](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@uced](https://forums.unrealengine.com/u/uced)\
**Post date:** [October 10, 2015, 8:47am UTC](https://forums.unrealengine.com/t/swidget-onmousebuttonup-triggers-only-on-double-click/334846/1 "2015-10-10T08:47:14Z")

</div>

Hello !

The SWidget::OnMouseButtonUp seems to trigger only after a double click, not a simple one.

To repro, override this function, for example:

```
// SYagHUDWidget inherits from SCompoundWidget
FReply SYagHUDWidget::OnMouseButtonUp(const FGeometry & MyGeometry, const FPointerEvent & MouseEvent)
{
	GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Red, TEXT("OnMouseButtonUp"));
	return FReply::Handled();
}

```

The message appears only when double clicking.

Cheers

Cedric

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [October 12, 2015, 7:27pm UTC](https://forums.unrealengine.com/t/swidget-onmousebuttonup-triggers-only-on-double-click/334846/2 "2015-10-12T19:27:18Z")

</div>

Hello uced,

Whatever widget you would like to have use the OnMouseUp override will need to capture the mouse in order for this to work correctly. The reason for this is that the mouse is already captured by something else, which is most likely the viewport.

Have a great day,

Sean Flint

---

<div class="post-metadata">

**Author:** ![uced](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@uced](https://forums.unrealengine.com/u/uced)\
**Post date:** [October 17, 2015, 5:56pm UTC](https://forums.unrealengine.com/t/swidget-onmousebuttonup-triggers-only-on-double-click/334846/3 "2015-10-17T17:56:58Z")

</div>

Hey Sean,

Thank you for you fast answer and my apologies for my delayed reaction, i was away.

I did try to suppress the viewport capture, but with no success:

```
UGameViewportClient* Viewport = GEngine->GameViewport;
Viewport->SetCaptureMouseOnClick(EMouseCaptureMode::NoCapture);

```

Is that the correct way to do this ?

Thanks

Cedric

---

<div class="post-metadata">

**Author:** ![Sean\_Flint](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Sean\_Flint](https://forums.unrealengine.com/u/Sean_Flint)\
**Post date:** [October 19, 2015, 3:22pm UTC](https://forums.unrealengine.com/t/swidget-onmousebuttonup-triggers-only-on-double-click/334846/4 "2015-10-19T15:22:47Z")

</div>

Take a look at the WidgetBlueprintLibrary.cpp file, as this contains examples of how to properly capture the mouse as well as many other functions that are related to widgets. What you’re doing is telling the viewport not to capture the mouse, but you also have to ensure that your widget knows to capture the mouse.

---

<div class="post-metadata">

**Author:** ![GSL](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GSL](https://forums.unrealengine.com/u/GSL)\
**Post date:** [May 22, 2025, 9:45am UTC](https://forums.unrealengine.com/t/swidget-onmousebuttonup-triggers-only-on-double-click/334846/6 "2025-05-22T09:45:05Z")

</div>

Maybe I miss some important detail ? Still can’t trigger OnMouseButtonUp correctly
