Class InputProvider
Represents an interface for an input provider that provides and implementation for sending and receiving device input
Implements
Namespace: Artemis.Core.Services
Assembly: Artemis.Core.dll
Syntax
public abstract class InputProvider : IDisposable
Constructors
InputProvider()
Creates a new instance of the InputProvider class.
Declaration
protected InputProvider()
Methods
Dispose()
Declaration
public void Dispose()
Dispose(bool)
Releases the unmanaged resources used by the object and optionally releases the managed resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
bool | disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
OnIdentifierReceived(object, 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
Declaration
protected virtual void OnIdentifierReceived(object identifier, InputDeviceType deviceType)
Parameters
Type | Name | Description |
---|---|---|
object | identifier | A value that can be used to identify this device |
InputDeviceType | deviceType | 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
Declaration
protected virtual void OnKeyboardDataReceived(ArtemisDevice? device, KeyboardKey key, bool isDown)
Parameters
Type | Name | Description |
---|---|---|
ArtemisDevice | device | The device that triggered the event |
KeyboardKey | key | The key that triggered the event |
bool | isDown | Whether the key is pressed down |
OnKeyboardToggleStatusReceived(KeyboardToggleStatus)
Invokes the KeyboardToggleStatusReceived event which the IInputService listens to as long as this provider is registered
Declaration
protected virtual void OnKeyboardToggleStatusReceived(KeyboardToggleStatus keyboardToggleStatus)
Parameters
Type | Name | Description |
---|---|---|
KeyboardToggleStatus | keyboardToggleStatus | The toggle status of the keyboard |
OnKeyboardToggleStatusRequested()
Called when the input service requests a KeyboardToggleStatusReceived event
Declaration
public virtual void OnKeyboardToggleStatusRequested()
OnMouseButtonDataReceived(ArtemisDevice?, MouseButton, bool)
Invokes the MouseButtonDataReceived event which the IInputService listens to as long as this provider is registered
Declaration
protected virtual void OnMouseButtonDataReceived(ArtemisDevice? device, MouseButton button, bool isDown)
Parameters
Type | Name | Description |
---|---|---|
ArtemisDevice | device | The device that triggered the event |
MouseButton | button | The button that triggered the event |
bool | isDown | 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
Declaration
protected virtual void OnMouseMoveDataReceived(ArtemisDevice? device, int cursorX, int cursorY, int deltaX, int deltaY)
Parameters
Type | Name | Description |
---|---|---|
ArtemisDevice | device | The device that triggered the event |
int | cursorX | The X position of the mouse cursor (not necessarily tied to the specific device) |
int | cursorY | The Y position of the mouse cursor (not necessarily tied to the specific device) |
int | deltaX | The movement delta in the horizontal direction |
int | deltaY | 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
Declaration
protected virtual void OnMouseScrollDataReceived(ArtemisDevice? device, MouseScrollDirection direction, int delta)
Parameters
Type | Name | Description |
---|---|---|
ArtemisDevice | device | The device that triggered the event |
MouseScrollDirection | direction | The direction in which was scrolled |
int | delta | The scroll delta (can positive or negative) |
Events
IdentifierReceived
Occurs when the input provided received a device identifier
Declaration
public event EventHandler<InputProviderIdentifierEventArgs>? IdentifierReceived
Event Type
Type | Description |
---|---|
EventHandler<InputProviderIdentifierEventArgs> |
KeyboardDataReceived
Occurs when the input provided has received keyboard data
Declaration
public event EventHandler<InputProviderKeyboardEventArgs>? KeyboardDataReceived
Event Type
Type | Description |
---|---|
EventHandler<InputProviderKeyboardEventArgs> |
KeyboardToggleStatusReceived
Occurs when the input provider has received new toggle data for keyboards
Declaration
public event EventHandler<InputProviderKeyboardToggleEventArgs>? KeyboardToggleStatusReceived
Event Type
Type | Description |
---|---|
EventHandler<InputProviderKeyboardToggleEventArgs> |
MouseButtonDataReceived
Occurs when the input provided has received mouse button data
Declaration
public event EventHandler<InputProviderMouseButtonEventArgs>? MouseButtonDataReceived
Event Type
Type | Description |
---|---|
EventHandler<InputProviderMouseButtonEventArgs> |
MouseMoveDataReceived
Occurs when the input provided has received mouse move data
Declaration
public event EventHandler<InputProviderMouseMoveEventArgs>? MouseMoveDataReceived
Event Type
Type | Description |
---|---|
EventHandler<InputProviderMouseMoveEventArgs> |
MouseScrollDataReceived
Occurs when the input provided has received mouse scroll data
Declaration
public event EventHandler<InputProviderMouseScrollEventArgs>? MouseScrollDataReceived
Event Type
Type | Description |
---|---|
EventHandler<InputProviderMouseScrollEventArgs> |