On Mouse Button Double Click Bug

Here’s a solution for that issue. We can just manually implement the double click action based on the “On Clicked” Event for the button.

The IsClicked is just a boolean variable indicating whether you have done a click before, it is set to false by default and the ResetIsClick is just a function which sets IsClicked to false. The important thing here is that you have to set a time in SetTimerByFunctionName that makes you feel like a button it is double clicked, to me 0.3 second seems okay.

Left Mouse Button “drag” and “one time click” is working using “OnPreviewMouseButtonDown” from the “override panel”.

However, double click still not working in 4.24.3.

Did you guys find the solution for that?

Hey guys,

I am using 4.23 version and got the same problem on mouse button double click and preview mouse button down to implement both drag and drop slots as well as double-click to use slot.

Here is my solution:
On the slot button, set click event, and picture will be the first one down below, create a variable to save left mouse button click count, give it a default value of 1.
And for override preview mouse button down function, the right mouse button will pop up the action menu which in this case can be ignored, then when detect failed, check whether drag can be detected, then everything will be fine.

Hope this is helpful for u guys.

1 Like

Having to write custom timer code to do a simple double click is really cringe.

2 Likes

This is still a problem in 5.1, do you guys have news about it? does this have any kind of solution or is the “custom double click via timer” the “only way”?

Cheers

1 Like

Ahhh noiiceee, this worked like a charm, I’m following the tutorial, great stuff! Best inventory tut out there IMO.
Just wanted to add 2 things regarding your function that I needed to change (assuming that this is indeed the same tutorial )

  1. “ClickCount” needs to be reset to 0 both times, or double click will only work the first time, after that single clicks will trigger;
  2. There’s a need to also verify if the Item “isUsable” or else the double click will consume any item, not only the usable ones.

For those who are wondering what tutorial series I’m talking about here’s a link to it, highly recommend it!
Inventory System Tutorial by UnrealGaimeDev

:metal:

I have been following the same guy and it has been great. For some reason to get this solution to work I had to set the #of clicks check to greater than 0.

In my case(custom 4.25),touch event dont has this issue,so mobile platform will not be effected,and can check “use mouse as touch” in project settings and it works good(its ok to still use on mouse button up in widgets)
If you dont want to do that for some reason,set the input mode to ui only also fix this (get player controller->SetInputModeUIOnly).as a great habbit you may overwriting OnMouseEnter and OnMouseLeave to set its use ui only mode and not.

Easy solution is to wrap your widget into Border (change Draw As: none). Border has built in double click event which you can utilize. However Border doesn’t have OnClick event so place a Button as a child to your Border.
End result should look like Border->Button->YourMainContainer.
This way you don’t need to override MouseDown events for entire widget and no need in any kind of delays and counters.

Double Click doesn’t work if on Border is placed Button

Still present as of 5.2.1.

Is there any indication of escalating this issue?

1 Like