Class InputProvider
Represents an interface for an input provider that provides and implementation for sending and receiving device input
public abstract class InputProvider : IDisposable
- Inheritance
-
objectInputProvider
- 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
disposingbooltrue 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
identifierstringA value that can be used to identify this device
deviceTypeInputDeviceTypeThe 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
deviceArtemisDeviceThe device that triggered the event
keyKeyboardKeyThe key that triggered the event
isDownboolWhether 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
keyboardToggleStatusKeyboardToggleStatusThe 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
deviceArtemisDeviceThe device that triggered the event
buttonMouseButtonThe button that triggered the event
isDownboolWhether 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
deviceArtemisDeviceThe device that triggered the event
cursorXintThe X position of the mouse cursor (not necessarily tied to the specific device)
cursorYintThe Y position of the mouse cursor (not necessarily tied to the specific device)
deltaXintThe movement delta in the horizontal direction
deltaYintThe 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
deviceArtemisDeviceThe device that triggered the event
directionMouseScrollDirectionThe direction in which was scrolled
deltaintThe scroll delta (can positive or negative)
Events
IdentifierReceived
Occurs when the input provided received a device identifier
public event EventHandler<InputProviderIdentifierEventArgs>? IdentifierReceived
Event Type
KeyboardDataReceived
Occurs when the input provided has received keyboard data
public event EventHandler<InputProviderKeyboardEventArgs>? KeyboardDataReceived
Event Type
KeyboardToggleStatusReceived
Occurs when the input provider has received new toggle data for keyboards
public event EventHandler<InputProviderKeyboardToggleEventArgs>? KeyboardToggleStatusReceived
Event Type
MouseButtonDataReceived
Occurs when the input provided has received mouse button data
public event EventHandler<InputProviderMouseButtonEventArgs>? MouseButtonDataReceived
Event Type
MouseMoveDataReceived
Occurs when the input provided has received mouse move data
public event EventHandler<InputProviderMouseMoveEventArgs>? MouseMoveDataReceived
Event Type
MouseScrollDataReceived
Occurs when the input provided has received mouse scroll data
public event EventHandler<InputProviderMouseScrollEventArgs>? MouseScrollDataReceived