natiny.view.set_focusable

Lua
natiny.view.set_focusable(view [, focusable])

Sets whether a press can give focus to a view. New views are focusable; a press on a non-focusable view instead selects its nearest focusable ancestor, or clears the focus when there is none.

Parameters

Name Type Default Description
view number View handle
focusable boolean false Whether a press can give focus to view

Example

Lua
-- Keep the backdrop pickable without letting it take the focus.
natiny.view.set_focusable(backdrop, false)

Notes

  • Setting false clears the focus when view or one of its descendants is currently focused.
  • This setting does not disable picking, hover, presses, clicks, or hooks.