docs.unity3d.com
    Show / Hide Table of Contents

    Class Focusable

    Base class for objects that can get the focus.

    Inheritance
    Object
    CallbackEventHandler
    Focusable
    VisualElement
    Inherited Members
    CallbackEventHandler.RegisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.RegisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TUserArgsType, TrickleDown)
    CallbackEventHandler.UnregisterCallback<TEventType>(EventCallback<TEventType>, TrickleDown)
    CallbackEventHandler.UnregisterCallback<TEventType, TUserArgsType>(EventCallback<TEventType, TUserArgsType>, TrickleDown)
    CallbackEventHandler.SendEvent(EventBase)
    CallbackEventHandler.HandleEvent(EventBase)
    CallbackEventHandler.HasTrickleDownHandlers()
    CallbackEventHandler.HasBubbleUpHandlers()
    CallbackEventHandler.ExecuteDefaultActionAtTarget(EventBase)
    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
    CallbackEventHandler.ExecuteDefaultAction(EventBase)

    Focus()

    Attempt to give the focus to this element.

    Declaration
    public virtual void Focus()
    In This Article
    • Constructors
      • Focusable()
    • Properties
      • canGrabFocus
      • delegatesFocus
      • focusable
      • focusController
      • tabIndex
    • Methods
      • Blur()
      • ExecuteDefaultAction(EventBase)
      • Focus()
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023