Table of Contents

Class InputProvider

Namespace
Artemis.Core.Services
Assembly
Artemis.Core.dll

Represents an interface for an input provider that provides and implementation for sending and receiving device input

public abstract class InputProvider : IDisposable
Inheritance
object
InputProvider
Implements

Constructors

InputProvider()

Creates a new instance of the InputProvider class.

protected InputProvider()

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

Releases the unmanaged resources used by the object and optionally releases the managed resources.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

OnIdentifierReceived(string, InputDeviceType)

Invokes the IdentifierReceived event which the IInputService listens to as long as this provider is registered

Except for on mouse movement, call this whenever you have an identifier ready for the core to process

protected virtual void OnIdentifierReceived(string identifier, InputDeviceType deviceType)

Parameters

identifier string

A value that can be used to identify this device

deviceType InputDeviceType

The type of device this identifier belongs to

OnKeyboardDataReceived(ArtemisDevice?, KeyboardKey, bool)

Invokes the KeyboardDataReceived event which the IInputService listens to as long as this provider is registered

protected virtual void OnKeyboardDataReceived(ArtemisDevice? device, KeyboardKey key, bool isDown)

Parameters

device ArtemisDevice

The device that triggered the event

key KeyboardKey

The key that triggered the event

isDown bool

Whether the key is pressed down

OnKeyboardToggleStatusReceived(KeyboardToggleStatus)

Invokes the KeyboardToggleStatusReceived event which the IInputService listens to as long as this provider is registered

protected virtual void OnKeyboardToggleStatusReceived(KeyboardToggleStatus keyboardToggleStatus)

Parameters

keyboardToggleStatus KeyboardToggleStatus

The toggle status of the keyboard

OnKeyboardToggleStatusRequested()

Called when the input service requests a KeyboardToggleStatusReceived event

public virtual void OnKeyboardToggleStatusRequested()

OnMouseButtonDataReceived(ArtemisDevice?, MouseButton, bool)

Invokes the MouseButtonDataReceived event which the IInputService listens to as long as this provider is registered

protected virtual void OnMouseButtonDataReceived(ArtemisDevice? device, MouseButton button, bool isDown)

Parameters

device ArtemisDevice

The device that triggered the event

button MouseButton

The button that triggered the event

isDown bool

Whether the button is pressed down

OnMouseMoveDataReceived(ArtemisDevice?, int, int, int, int)

Invokes the MouseMoveDataReceived event which the IInputService listens to as long as this provider is registered

protected virtual void OnMouseMoveDataReceived(ArtemisDevice? device, int cursorX, int cursorY, int deltaX, int deltaY)

Parameters

device ArtemisDevice

The device that triggered the event

cursorX int

The X position of the mouse cursor (not necessarily tied to the specific device)

cursorY int

The Y position of the mouse cursor (not necessarily tied to the specific device)

deltaX int

The movement delta in the horizontal direction

deltaY int

The movement delta in the vertical direction

OnMouseScrollDataReceived(ArtemisDevice?, MouseScrollDirection, int)

Invokes the MouseScrollDataReceived event which the IInputService listens to as long as this provider is registered

protected virtual void OnMouseScrollDataReceived(ArtemisDevice? device, MouseScrollDirection direction, int delta)

Parameters

device ArtemisDevice

The device that triggered the event

direction MouseScrollDirection

The direction in which was scrolled

delta int

The scroll delta (can positive or negative)

Events

IdentifierReceived

Occurs when the input provided received a device identifier

public event EventHandler<InputProviderIdentifierEventArgs>? IdentifierReceived

Event Type

EventHandler<InputProviderIdentifierEventArgs>

KeyboardDataReceived

Occurs when the input provided has received keyboard data

public event EventHandler<InputProviderKeyboardEventArgs>? KeyboardDataReceived

Event Type

EventHandler<InputProviderKeyboardEventArgs>

KeyboardToggleStatusReceived

Occurs when the input provider has received new toggle data for keyboards

public event EventHandler<InputProviderKeyboardToggleEventArgs>? KeyboardToggleStatusReceived

Event Type

EventHandler<InputProviderKeyboardToggleEventArgs>

MouseButtonDataReceived

Occurs when the input provided has received mouse button data

public event EventHandler<InputProviderMouseButtonEventArgs>? MouseButtonDataReceived

Event Type

EventHandler<InputProviderMouseButtonEventArgs>

MouseMoveDataReceived

Occurs when the input provided has received mouse move data

public event EventHandler<InputProviderMouseMoveEventArgs>? MouseMoveDataReceived

Event Type

EventHandler<InputProviderMouseMoveEventArgs>

MouseScrollDataReceived

Occurs when the input provided has received mouse scroll data

public event EventHandler<InputProviderMouseScrollEventArgs>? MouseScrollDataReceived

Event Type

EventHandler<InputProviderMouseScrollEventArgs>