Any way to have control over showing mouse cursor and Enhanced Input actions with mouse input without resorting to CommonUI?

I’m having issues surrounding the Show Mouse Cursor option and using the mouse as an input method through the enhanced input system.

I have both Left Mouse Button and Mouse XY 2D-Axis setup as mappings for actions in my input mapping context. I also would like to sometimes have the mouse cursor shown on screen.

When setting Show Mouse Cursor to true in my PlayerController, the left click events work fine, but the 2D-Axis inputs only register while the left mouse button is actively held down.

Setting Viewport Mouse Capture Mode to Capture Permanently and Input Mode to Game Only allows my mouse 2d-axis inputs to run while the cursor is shown on screen, but only until I click for the first time, at which point the 2d-axis inputs once again only run while I am actively holding down the left mouse button. Additionally, this configuration requires me to double click to activate the left click input.

I found this tutorial: https://www.youtube.com/watch?v=A9dp3cmCFtQ which seems to show how to effectively control all of these variable to work however you want, but only in the context of the CommonUI plugin. Is there any way to show the mouse cursor without impacting mouse capture and Enhanced Input without using the plugin? I’ll add it if I have to, but it seems like a lot of overhead for such a small requirement

Thanks!

Hello,

If you have a widget present on a screen, it might be consuming your mouse inputs. I believe this is happening because when you use Set Show Mouse Cursor the input is first directed into UI. You could try unchecking focusable on your widget and in override functions for mouse down (On Preview Mouse Button down / On Mouse Button down, connect the execution pin with return node and set it to unhandled.

I believe preview fires first unless you’re already using On Mouse Button Down, but if you’re going to test it, do it for both. You can also verify if these are firing by sticking a print string in said functions.

I’ve got a HUD style widget and a widget that I’ve set as a software cursor both appearing during this. I’ll try updating them based on this and report back!

After applying these changes I’m in the same spot: mouse cursor appears on screen, mouse click inputs from Enhanced Input fire in a single click, but to get Mouse Axis-2D inputs I must be holding down the mouse button

Well, I decided to take the nuclear route and just uncheck Show Mouse Cursor in my PlayerController and then add a “cursor” widget to the viewport and just set its position to the mouse position every frame (which still updates despite being captured by enhanced input)