Class InputExtensions | Package Manager UI website
docs.unity3d.com
    Show / Hide Table of Contents

    Class InputExtensions

    Various useful extension methods.

    Inheritance
    System.Object
    InputExtensions
    Namespace: UnityEngine.InputSystem
    Syntax
    public static class InputExtensions

    Methods

    IsActive(TouchPhase)

    Declaration
    public static bool IsActive(this TouchPhase phase)
    Parameters
    Type Name Description
    TouchPhase phase
    Returns
    Type Description
    System.Boolean

    IsEndedOrCanceled(TouchPhase)

    Declaration
    public static bool IsEndedOrCanceled(this TouchPhase phase)
    Parameters
    Type Name Description
    TouchPhase phase
    Returns
    Type Description
    System.Boolean

    IsModifierKey(Key)

    Check if a Key enum value represents a modifier key.

    Declaration
    public static bool IsModifierKey(this Key key)
    Parameters
    Type Name Description
    Key key

    The key enum value you want to check.

    Returns
    Type Description
    System.Boolean
    Remarks

    Returns true if this key is a modifier key, false otherwise. Modifier keys are any keys you can hold down to modify the output of other keys pressed simultaneously, such as the "shift" or "control" keys.

    IsTextInputKey(Key)

    Check if a Key enum value represents key generating text input.

    Declaration
    public static bool IsTextInputKey(this Key key)
    Parameters
    Type Name Description
    Key key

    The key enum value you want to check.

    Returns
    Type Description
    System.Boolean
    Remarks

    Returns true if this key is a key generating non-whitespace character input, false otherwise.

    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