docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class BrushShortcutHandler<TKey>

    Provides methods for handling brush shortcuts.

    Inheritance
    object
    BrushShortcutHandler<TKey>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEditor.TerrainTools
    Assembly: Unity.TerrainTools.Editor.dll
    Syntax
    public class BrushShortcutHandler<TKey>
    Type Parameters
    Name Description
    TKey

    The key type that represents the keyboard key.

    Methods

    AddActions(TKey, Action, Action)

    Subscribes the key to the passed in press and release Actions.

    Declaration
    public virtual void AddActions(TKey key, Action onPressed = null, Action onReleased = null)
    Parameters
    Type Name Description
    TKey key

    The TKey type to add.

    Action onPressed

    The Action to call on key press.

    Action onReleased

    The Action to call on key release.

    HandleShortcutChanged(ShortcutArguments, TKey)

    Handles ShortcutArguments changes when using shortcuts.

    Declaration
    public void HandleShortcutChanged(ShortcutArguments args, TKey key)
    Parameters
    Type Name Description
    ShortcutArguments args

    The data for shortcut action methods invoked by the shortcut system.

    TKey key

    The TKey type to check.

    Remarks

    This method handles the invocation of a shortcuts on press and release actions using ShortcutArguments.

    See Also
    TerrainToolShortcutContext
    ClutchShortcutAttribute

    IsShortcutPressed(TKey)

    Determines whether the key is pressed.

    Declaration
    public bool IsShortcutPressed(TKey key)
    Parameters
    Type Name Description
    TKey key

    The TKey type to check.

    Returns
    Type Description
    bool

    Returns true when the key is currently pressed. Otherwise, returns false.

    RemoveActions(TKey)

    Unsubscribes the key from its press and release actions.

    Declaration
    public void RemoveActions(TKey key)
    Parameters
    Type Name Description
    TKey key

    The TKey type to remove.

    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)