Disable mouse input when over widget

I just tested this and it works fine. I can click outside the editable text (but still on the widget) and keep typing as if nothing happened. If you want to click outside the widget (on the viewport) and still keep focus, then you’d need extra steps:

  • either use UI Only input mode
  • or override onFocusLost and restore back to the Editable Text.

  • your current script returns defaults (false branch) when you click with something else than LMB, though - not sure if this is desired, the previous description was unclear:

I don’t want that when you click with the mouse this eliminates the focus from the editable text

If you want every mouse button to be consumed and redirect focus to the Editable Text:

  • ensure the widgets you’re clicking are visible so they can consume input (handle it)
  • spamming mouse buttons will trigger double-click, it also needs to be handled:

1 Like