Header menu logo Mibo

Input Module

Factory and service access for the core input polling component.

Functions and values

Function or value Description

create game

Full Usage: create game

Parameters:
Returns: GameComponent

Creates an input component that polls hardware each frame.

The component implements both IGameComponent (for the MonoGame lifecycle) and IInput (for reactive input access). Normally called internally by Program.withInput.

game : Game
Returns: GameComponent

getService ctx

Full Usage: getService ctx

Parameters:
Returns: IInput

Gets the IInput service from the game context. Throws if the service is not registered. Use Program.withInput to ensure registration.

ctx : GameContext
Returns: IInput

tryGetService ctx

Full Usage: tryGetService ctx

Parameters:
Returns: IInput voption

Attempts to get the IInput service from the game context. Returns ValueNone if the service is not registered (i.e., Program.withInput wasn't used).

ctx : GameContext
Returns: IInput voption

Type something to start searching.