Class Focusable
Base class for objects that can get the focus.
Inherited Members
Namespace: UnityEngine.UIElements
Syntax
public abstract class Focusable : CallbackEventHandler, IEventHandler
Remarks
The focus is used to designate an element that will receive keyboard events.
Constructors
Focusable()
Declaration
protected Focusable()
Properties
canGrabFocus
Return true if the element can be focused.
Declaration
public virtual bool canGrabFocus { get; }
Property Value
Type | Description |
---|---|
Boolean |
delegatesFocus
Whether the element should delegate the focus to its children.
Declaration
public bool delegatesFocus { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
focusable
True if the element can be focused.
Declaration
public bool focusable { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
focusController
Return the focus controller for this element.
Declaration
public abstract FocusController focusController { get; }
Property Value
Type | Description |
---|---|
FocusController |
tabIndex
An integer used to sort focusables in the focus ring. Must be greater than or equal to zero.
Declaration
public int tabIndex { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
Blur()
Tell the element to release the focus.
Declaration
public virtual void Blur()
ExecuteDefaultAction(EventBase)
Declaration
protected override void ExecuteDefaultAction(EventBase evt)
Parameters
Type | Name | Description |
---|---|---|
EventBase | evt |
Overrides
Focus()
Attempt to give the focus to this element.
Declaration
public virtual void Focus()