docs.unity3d.com
    Show / Hide Table of Contents

    Class TimelineShortcutAttribute

    Use this attribute to make an action work with the shortcut system.

    Inheritance
    Object
    TimelineShortcutAttribute
    Namespace: UnityEditor.Timeline.Actions
    Syntax
    public class TimelineShortcutAttribute : ShortcutManagement.ShortcutAttribute
    Examples

    TimelineShortcutAttribute needs to be added to a static method.

        public class ShortcutAction : TimelineAction
        {
            public override ActionValidity Validate(ActionContext _)
            {
                return ActionValidity.Valid;
            }
    
            public override bool Execute(ActionContext _)
            {
                Debug.Log("Action executed.");
                return true;
            }
    
            [TimelineShortcut("Test Action", KeyCode.K, ShortcutModifiers.Shift | ShortcutModifiers.Alt)]
            public static void HandleShortCut(ShortcutArguments args)
            {
                Invoker.InvokeWithSelected<ShortcutAction>();
            }
        }

    Constructors

    TimelineShortcutAttribute(String, KeyCode, ShortcutModifiers)

    TimelineShortcutAttribute Constructor

    Declaration
    public TimelineShortcutAttribute(string id, KeyCode defaultKeyCode, ShortcutModifiers defaultShortcutModifiers = null)
    Parameters
    Type Name Description
    String id

    Id to register the shortcut. It will automatically be prefix by 'Timeline/' in order to be in the 'Timeline' section of the shortcut manager.

    KeyCode defaultKeyCode

    Optional key code for default binding.

    ShortcutModifiers defaultShortcutModifiers

    Optional shortcut modifiers for default binding.

    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