logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Interface IUiMouseInteractionLock

    Interface for managing mouse/pointer interaction locks in the UI system.
    Used to temporarily disable pointer input to UI elements (except the active owner) while maintaining keyboard navigation.
    Tracks ownership so that when locked, only the owner's hierarchy receives pointer events.

    Namespace: Serenity.Ui.Application.Interfaces
    Assembly: Serenity.Ui.Application.dll
    Syntax
    public interface IUiMouseInteractionLock

    Properties

    ActiveOwner

    Gets the current lock owner's GameObject, or null if not locked.

    Declaration
    GameObject ActiveOwner { get; }
    Property Value
    Type Description
    GameObject

    IsLocked

    Gets whether mouse interaction is currently locked.

    Declaration
    bool IsLocked { get; }
    Property Value
    Type Description
    bool

    Methods

    ForceUnlockAll()

    Forces release of all mouse interaction locks regardless of owner.
    Use for emergency cleanup scenarios.

    Declaration
    void ForceUnlockAll()

    ForceUnlockOwnedBy(GameObject)

    Forces release of all mouse interaction locks owned by the specified owner.
    Use for cleanup scenarios like component destruction or error recovery.

    Declaration
    void ForceUnlockOwnedBy(GameObject owner)
    Parameters
    Type Name Description
    GameObject owner

    The GameObject to release locks for.

    IsPointerAllowedFor(Transform)

    Checks if a given Transform is allowed to receive pointer events.
    Returns true if not locked, or if the target is part of the active owner's hierarchy.

    Declaration
    bool IsPointerAllowedFor(Transform target)
    Parameters
    Type Name Description
    Transform target

    The Transform to check.

    Returns
    Type Description
    bool

    True if pointer events should be allowed for this target.

    Lock(GameObject)

    Acquires a mouse interaction lock for the specified owner.
    While locked, only UI elements that are children of the owner's Transform will receive pointer events.
    If already locked by another owner, this call is ignored (first owner wins).

    Declaration
    void Lock(GameObject owner)
    Parameters
    Type Name Description
    GameObject owner

    The GameObject that owns the lock (e.g., the input component's root).

    Unlock(GameObject)

    Releases the mouse interaction lock for the specified owner.
    Only the current owner can release the lock. Other callers are ignored.

    Declaration
    void Unlock(GameObject owner)
    Parameters
    Type Name Description
    GameObject owner

    The GameObject that owns the lock.

    In this article
    © 2026 Serenity. All Rights Reserved