Hello,
I’d like to know if there is anything I could use (code or BP) to disable Mouse Inputs completely in UI.
For instance, even if the mouse isn’t bound to any action (using EnhanceInputs), the button clicks generates focus events that we have to handle in widgets even though we don’t want to support the Mouse inputs.
Any intel on the topic would help a lot!
Best,
Hi Simon,
There are a few options here:
- You could register an input preprocessor via FSlateApplication::RegisterInputPreProcessor which would consume all mouse events (override the relevant handlers and return true) to ensure they’re never passed down to any individual widgets. You can unregister/reregister this as needed if you ever do need mouse controls.
- You could add a widget to the viewport above everything else that is transparent and takes up the full screen, consuming mouse input events and setting focus back to the currently focused widget. This would require some manual tracking of which widget has focus, or some code to expose FSlateApplication::GetUserFocusedWidget to the widget blueprint.
Best,
Cody