Table of Contents

Interface IInputContext

Namespace
Gloam.Core.Input
Assembly
Gloam.Core.dll

Represents an input context that can handle input actions and bindings

public interface IInputContext

Properties

IsActive

Whether this context is currently active

bool IsActive { get; set; }

Property Value

bool

Name

Name of the input context

string Name { get; }

Property Value

string

Priority

Priority of this context (higher priority contexts are processed first)

int Priority { get; }

Property Value

int

Methods

AddBinding(InputBinding, Action)

Adds an input binding to this context with synchronous handler

void AddBinding(InputBinding binding, Action handler)

Parameters

binding InputBinding
handler Action

AddBinding(InputBinding, Func<Task>)

Adds an input binding to this context

void AddBinding(InputBinding binding, Func<Task> handler)

Parameters

binding InputBinding
handler Func<Task>

ClearBindings()

Clears all bindings from this context

void ClearBindings()

ProcessInputAsync(IInputDevice, CancellationToken)

Processes input for this context

Task<bool> ProcessInputAsync(IInputDevice inputDevice, CancellationToken ct = default)

Parameters

inputDevice IInputDevice
ct CancellationToken

Returns

Task<bool>

True if input was handled and should not propagate to lower priority contexts

RemoveBinding(InputAction)

Removes an input binding from this context

bool RemoveBinding(InputAction action)

Parameters

action InputAction

Returns

bool