docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Class PointerInputModule.MouseState

    Tracks the state of every mouse button that the input module processes.

    Inheritance
    object
    PointerInputModule.MouseState
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: UnityEngine.EventSystems
    Assembly: UnityEngine.UI.dll
    Syntax
    protected class PointerInputModule.MouseState

    Methods

    AnyPressesThisFrame()

    Checks whether any tracked mouse button was pressed this frame.

    Declaration
    public bool AnyPressesThisFrame()
    Returns
    Type Description
    bool

    True if at least one tracked button was pressed this frame.

    AnyReleasesThisFrame()

    Checks whether any tracked mouse button was released this frame.

    Declaration
    public bool AnyReleasesThisFrame()
    Returns
    Type Description
    bool

    True if at least one tracked button was released this frame.

    GetButtonState(InputButton)

    Returns the tracked state of a mouse button, and starts tracking the button if it isn't tracked yet.

    Declaration
    public PointerInputModule.ButtonState GetButtonState(PointerEventData.InputButton button)
    Parameters
    Type Name Description
    PointerEventData.InputButton button

    The mouse button.

    Returns
    Type Description
    PointerInputModule.ButtonState

    The state of the given mouse button.

    SetButtonState(InputButton, FramePressState, PointerEventData)

    Sets the press state and the pointer data of a mouse button for this frame.

    Declaration
    public void SetButtonState(PointerEventData.InputButton button, PointerEventData.FramePressState stateForMouseButton, PointerEventData data)
    Parameters
    Type Name Description
    PointerEventData.InputButton button

    The mouse button.

    PointerEventData.FramePressState stateForMouseButton

    The press state of the button for this frame.

    PointerEventData data

    The pointer event data of the button for this frame.

    In This Article
    Back to top
    Copyright © 2026 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)