Table of Contents

Class InputSystem

Namespace
Icy.MonoGame.Input
Assembly
IcyUI.MonoGame.dll

Represents an instance of the input system that listens for MonoGame input devices.

public class InputSystem : IInputSystem, IEnumerable<IInputDeviceListener>, IEnumerable, IInitializable, IUpdateableInput
Inheritance
InputSystem
Implements
Inherited Members
Extension Methods

Constructors

InputSystem(Game)

Initializes a new instance of the InputSystem class.

public InputSystem(Game game)

Parameters

game Game

An instance of the game to access input API.

Properties

Clipboard

Gets the service for the platform clipboard implementation.

public IClipboard Clipboard { get; }

Property Value

IClipboard

Events

Gets the service that provides input events for the UI elements.

public IInputEventSystem Events { get; }

Property Value

IInputEventSystem

Gamepad

Gets the listener for the gamepad events.

public IGamepadInput? Gamepad { get; }

Property Value

IGamepadInput

Remarks

Note that this UI framework doesn't define multiple gamepad support, so only main gamepad input will be received. You can implement it by yourself if it's necessary for your game. However, it will require multiple focus support. For that purposes, you'll have to make your own control focus system.

IsInitialized

Gets a value indicating whether the object has been initialized.

public bool IsInitialized { get; }

Property Value

bool

Keyboard

Gets the listener for the keyboard events.

public IKeyboardInput? Keyboard { get; }

Property Value

IKeyboardInput

Mouse

Gets the listener for the mouse events.

public IMouseInput Mouse { get; }

Property Value

IMouseInput

Touch

Gets the service for the touch events.

public ITouchInput? Touch { get; }

Property Value

ITouchInput

Methods

GetEnumerator()

Returns an enumerator that iterates through the collection.

public IEnumerator<IInputDeviceListener> GetEnumerator()

Returns

IEnumerator<IInputDeviceListener>

An enumerator that can be used to iterate through the collection.

GetInputDevice<T>()

Gets an input device listener for the specified type.

public T GetInputDevice<T>() where T : IInputDeviceListener

Returns

T

An input device listener for the specified device type.

Type Parameters

T

Type of the device to get listener for.

Exceptions

KeyNotFoundException

Occurs when the device for the specified type is not connected.

Initialize()

Initializes an instance of an object.

public void Initialize()

IsDeviceAvailable<T>()

Determines whether the specified input device listener is connected to the input system.

public bool IsDeviceAvailable<T>() where T : IInputDeviceListener

Returns

bool

true if the device is available; otherwise false.

Type Parameters

T

Type of the input device listener.

TryGetInputDevice<T>(out T?)

Tries to get a listener for the specified input device.

public bool TryGetInputDevice<T>(out T? device) where T : IInputDeviceListener

Parameters

device T

Listener for the specified device.

Returns

bool

true if the device listener was acquired successfully; otherwise false.

Type Parameters

T

Type of the device to get a listener for.

Update(TimeSpan)

Performs the update for the component.

public void Update(TimeSpan elapsed)

Parameters

elapsed TimeSpan