docs.unity3d.com
    Show / Hide Table of Contents

    Class BrushShortcutHandler<TKey>

    Provides methods for handling brush shortcuts.

    Inheritance
    Object
    BrushShortcutHandler<TKey>
    Inherited Members
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: UnityEditor.TerrainTools
    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 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 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 type to check.

    Returns
    Type Description
    Boolean

    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 type to remove.

    Back to top
    Copyright © 2023 Unity Technologies
    • 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 Friday, November 3, 2023