I only use Common UI in the context of Lyra. I can’t speak to how it may be implemented in other contexts.
@illYay found applicable Lyra C++ code that makes Common UI work well. If you don’t use Lyra, you’ll have to duplicate this (and other similar related) code into your own code base and modify as needed.
@conscienc3 the double click issue can be fixed with a custom 5.1 engine hack and some C++ overrides in your project.
Ultimately the problem is in UCommonUIActionRouterBase
::ApplyUIInputConfig
. You need to make it protected
virtual
, and promote ActiveInputConfig
to be protected
as well.
Then you derive from UCommonUIActionRouterBase
to your custom class, override ApplyUIInputConfig
and make whatever input changes you want for your project.
Two clicks are consumed in your case probably because you are not capturing the mouse in your current input config. Thus the first click initiates the capture and the second is the first one your project sees.
You need to set the mouse to be captured including the initial mouse down to have every single click always go to your project. Something like this:
GameViewportClient->SetMouseCaptureMode(EMouseCaptureMode::CapturePermanently_IncludingInitialMouseDown);
In your project using Common UI, THIS is where you manage the input modes, capture modes, everything related to user input: your ApplyUIInputConfig
override.
In 5.2 this won’t require a custom engine. In 5.1 it does, I listed the minimal required changes above.
Good luck!