I have a Blueprint that when it is clicked something happens, but the problem I’m having is there seems to be a re-trigger delay. If I hit the mouse button twice really fast, the second click is not registered, but if I click then wait a second and click again, the second click will register. First off, am I the only one having this problem? If you could test this on your end it would be greatly appreciated. Just click the mouse twice really fast and see if both clicks register for you (make sure you are using onClicked event and not Left Mouse Button event). Secondly, does anyone know how to get rid of this delay or know what is going on? I really need the player to be able to double click really fast. I’ve dug through the documentation and messed around with different settings on the Blueprint and couldn’t find anything.
Yes, I see the same thing. Interestingly, if I click twice quickly I get one Click but two Release events. I tried messing with the Project Settings/Input/Double Click Time value but neither small (0) nor large (10 secs) values made any apparent difference.
my probably stupid guess is that, it’s like you said to have a hardcoded time window to register a single click. so when you press and hold it could generate drag instead of click(i don’t even know if there is a drag event).
it might be a good time to check source code.
After checking the source code, I could not find any hardcoded time.
(both in PlayerController.cpp and EditorViewportClient.cpp and UPrimitiveComponent)
But I found something interesting, if you have a clickable actor, as long as you don’t click on the same spot twice, click and immediately move mouse off the side a bit, you can generate click event as fast as you like.
(I set the double click time to 0.001, don’t know if this matters.)
If I just spam click at the same spot, then there seems to be some other function that took over, thus does not generate independent click events.
I guess if this is something you want to do, you probably have to deal with this from source code.
Further discovery:
D:\UnrealEngineSource\Engine\Config\BaseEngine.ini(1240):
[/Script/Engine.UIInteraction]
UIJoystickDeadZone=0.9
AxisRepeatDelay=0.2
MouseButtonRepeatDelay=0.15
DoubleClickTriggerSeconds=0.5
DoubleClickPixelTolerance=1
D:\UnrealEngineSource\Engine\Source\Runtime\Engine\Private\UserInterface\PlayerInput.cpp(100):
switch(Event)
{
case IE_Pressed:
case IE_Repeat:
KeyState.RawValueAccumulator.X = AmountDepressed;
KeyState.EventAccumulator[Event].Add(++EventCount);
if (KeyState.bDownPrevious == false)
{
// check for doubleclick
// note, a tripleclick will currently count as a 2nd double click.
if ( World->TimeSince(KeyState.LastUpDownTransitionTime) < GetDefault<UInputSettings>()->DoubleClickTime )
{
KeyState.EventAccumulator[IE_DoubleClick].Add(++EventCount);
}
// just went down
KeyState.LastUpDownTransitionTime = World->GetTimeSeconds();
}
break;
case IE_Released:
KeyState.RawValueAccumulator.X = 0.f;
KeyState.EventAccumulator[IE_Released].Add(++EventCount);
break;
case IE_DoubleClick:
KeyState.RawValueAccumulator.X = AmountDepressed;
KeyState.EventAccumulator[IE_Pressed].Add(++EventCount);
KeyState.EventAccumulator[IE_DoubleClick].Add(++EventCount);
break;
}
Is this issue being seen with hitboxes or component events? If so I fixed that just after 4.1 was branched. You can see the fix here: https://github.com/EpicGames/UnrealEngine/commit/eda97cbd2a6dd6b741951d25c6d62ef7efddda2f
The UIInteraction ini settings are old legacy. Apologies for them being there, I’ve just removed them.
The mouse double click delay is generated by the operating system and for the rest of the keys (like double clicking space) that is in BaseInput.ini in the Engine.InputSettings section (and editable through the project settings UI).
@Marc, btw, since IE_DoubleClick is gernerated by system, wouldn’t it be better to let some global settings to let user enable/disable treating double click as click event for hitbox or components?
Maybe in a base clickable class/interface and implement that? I can see if in the future where people want a double click event, this fix would then prevent that from happening.
Also that explains there are no time window to generate IE_DoubleClick for Mouse inputs. Thanks!
I’m having the same issue in UMG. Anyone find a way around it?
You can always work around the implementation of any of our widgets by handling the slate events yourself and make your own button out of a user widget. All the same virtual calls are available (well sans a couple for complexity), but the mouse ones are there, you can directly handle mouse down and up.
Hate to drag up an old thread, but im seeing this on 4.10.4 i have an assault rifle set up and if i single shot quite fast, only about 3/4 of the shots are fired, this used to be a problem on UDK as you can see here UDK Mouse Click Delay - Epic Games Forums no idea how to fix this on the newer engine? ideas?
Thanks
Nigel
I know some info has already been shared and that this is an old thread. I am posting in hopes that this may help someone else. Hit the source code, it receives a click or double click. That is what this delay is. If your widget doesn’t override Double Click functionality, its not like it will call just MouseDown. It makes sense for a MouseDown and DoubleClick to be two separate things. In my case I just wanted it to fire the MouseDown code if the mouse was down, regardless of double click detection. My workaround was to make a function that did what MouseDown did. Then I call that function in both MouseDown and DoubleClick override functions in the widget blueprint.
P.S. I also messed with the double click time in project settings -> input. I didn’t notice a difference with changing that either.
It works! Thank you so much. I had been searching for and trying various methods, but thankfully, the problem is solved!