logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Interface IPrimaryInputGate

    Gate for awaiting first interaction from any device in order to determine the primary controller and return its metadata.

    Namespace: Serenity.InputGateway.Domain.Interfaces.Components
    Assembly: Serenity.InputGateway.Application.dll
    Syntax
    public interface IPrimaryInputGate

    Methods

    AwaitAsync(CancellationToken)

    Awaits any unpaired device to send input, sets it as the primary device, and returns: (scheme, deviceId, displayName).
    Must be reentrant: each call re-arms the gate.

    Declaration
    Task<(string scheme, string deviceId, string displayName)> AwaitAsync(CancellationToken cancellationToken)
    Parameters
    Type Name Description
    CancellationToken cancellationToken

    The cancellation token to cancel the operation.

    Returns
    Type Description
    Task<(string scheme, string deviceId, string displayName)>

    A task that represents the asynchronous operation, containing a tuple with scheme, deviceId, and displayName of the primary device.

    Initialize(object, IPlayerInputService, ILogService)

    Initializes the gate with the player input service and logging service.

    Declaration
    void Initialize(object playerInputHandler, IPlayerInputService inputService, ILogService logService)
    Parameters
    Type Name Description
    object playerInputHandler

    The player input handler.

    IPlayerInputService inputService

    The player input service.

    ILogService logService

    The logging service for centralized logging.

    In this article
    © 2026 Serenity. All Rights Reserved