Common UI | CanProcessNormalGameInput question

Hello, we’ve been using Common UI for the past year or so and it is great. It solved so many problems for us.

In our game, we have Dialogue widget which is pushed to Menu stack, It has ECommonInputMode::Menu InputType and It has CapturePermanently for mouse.

Our problem is that by default ActionRouter will let the input pass down to game even if our widget’s InputType is Menu (because of mouse capture).

We don’t want that to happend and we want for widget to handle input only.

I was under impression that ECommonInputMode::All mode is specifically designed in that case if we did wanted to let input pass further down.

Now, I know there are several ways to prevent this, we can try to hide mouse, remove input contexts, add placeholder actions in widget so that it does not pass down, edit ActionRouter’s code… etc.

Our solution currently is to remove contexts.

But I was curious why is this rule implemented and if there is more elegant solution for these kind of scenarios.

Hi,

The input mode here has more to do with button inputs; we’ll route button presses to whichever widget has focus, and ECommonInputMode::All lets unhandled input fall through to the player controller to affect the game world, while ECommonInputMode::Menu blocks it regardless of whether a UI widget handles it. Separately from that, the Mouse Capture Mode determines whether or not the viewport should capture mouse clicks, and while it has capture it’ll directly receive *all* input until capture is released.

The idea behind that handling in CanProcessNormalGameInput is that during capture, we still want those inputs to fall through to the player controller as they would normally. This makes more sense with something like CaptureOnMouseDown where you may hold the mouse in the 3d world somewhere and use your move keys to move a character, but once you release you want those keys to resume navigating in the UI. For your case, if you want input to be blocked from the game outright then you probably want to use NoCapture instead, and once the menu is closed you’ll fall back to the default input config (or the config of a different activatable widget) which once again allows the viewport to capture the mouse.

Best,

Cody

Ok, thanks for reply. I didn’t have time to look into this. But this makes sense.

In my case when i want widget to take all mouse and keyboard focus, but mouse needs to be hidden, I would set it to ECommonInputMode::Menu and no capture, but I will try to hide mouse manually from widget, This should give me the result.

Ty for response and good luck.