Table of Contents

Interface IInputService

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

A service that allows you to interact with keyboard and mice input events

public interface IInputService : IDisposable
Inherited Members

Properties

KeyboardToggleStatus

Gets the current keyboard toggle status

KeyboardToggleStatus KeyboardToggleStatus { get; }

Property Value

KeyboardToggleStatus

Methods

AddInputProvider(InputProvider)

Adds an input provided

void AddInputProvider(InputProvider inputProvider)

Parameters

inputProvider InputProvider

The input provider the add

BustIdentifierCache()

Clears the identifier cache

void BustIdentifierCache()

GetDeviceByIdentifier(InputProvider, object, InputDeviceType)

Attempts to identify the device using the provided identifier

ArtemisDevice? GetDeviceByIdentifier(InputProvider provider, object identifier, InputDeviceType type)

Parameters

provider InputProvider

The input provider to identify the device for

identifier object

The value to use to identify the device

type InputDeviceType

A device type to fall back to if no match is found

Returns

ArtemisDevice

If found, the Artemis device matching the provider and identifier

IdentifyDevice(ArtemisDevice)

Identifies the provided device by assigning the next received device identification to it

void IdentifyDevice(ArtemisDevice device)

Parameters

device ArtemisDevice

The device to identify - Must be a keyboard or mouse

IsButtonDown(MouseButton)

Determines whether the button key is pressed by any device

bool IsButtonDown(MouseButton button)

Parameters

button MouseButton

The button to check

Returns

bool

true if the button is pressed; otherwise false

IsKeyDown(KeyboardKey)

Determines whether the provided key is pressed by any device

bool IsKeyDown(KeyboardKey key)

Parameters

key KeyboardKey

The key to check

Returns

bool

true if the key is pressed; otherwise false

ReleaseAll()

Flush all currently pressed buttons/keys

void ReleaseAll()

RemoveInputProvider(InputProvider)

Removes an input provided

void RemoveInputProvider(InputProvider inputProvider)

Parameters

inputProvider InputProvider

The input provider the remove

StopIdentify()

Cancels identifying the device last passed to IdentifyDevice(ArtemisDevice)

void StopIdentify()

Events

DeviceIdentified

Occurs when a device has been identified after calling IdentifyDevice(ArtemisDevice)

event EventHandler DeviceIdentified

Event Type

EventHandler

KeyboardKeyDown

Occurs whenever a key on a keyboard was pressed

event EventHandler<ArtemisKeyboardKeyEventArgs> KeyboardKeyDown

Event Type

EventHandler<ArtemisKeyboardKeyEventArgs>

KeyboardKeyUp

Occurs whenever a key on a keyboard was released

event EventHandler<ArtemisKeyboardKeyEventArgs> KeyboardKeyUp

Event Type

EventHandler<ArtemisKeyboardKeyEventArgs>

KeyboardKeyUpDown

Occurs whenever a key on a keyboard was pressed or released

event EventHandler<ArtemisKeyboardKeyUpDownEventArgs> KeyboardKeyUpDown

Event Type

EventHandler<ArtemisKeyboardKeyUpDownEventArgs>

KeyboardToggleStatusChanged

Occurs whenever a one or more of the keyboard toggle statuses changed

event EventHandler<ArtemisKeyboardToggleStatusArgs> KeyboardToggleStatusChanged

Event Type

EventHandler<ArtemisKeyboardToggleStatusArgs>

MouseButtonDown

Occurs whenever a button on a mouse was pressed

event EventHandler<ArtemisMouseButtonEventArgs> MouseButtonDown

Event Type

EventHandler<ArtemisMouseButtonEventArgs>

MouseButtonUp

Occurs whenever a button on a mouse was released

event EventHandler<ArtemisMouseButtonEventArgs> MouseButtonUp

Event Type

EventHandler<ArtemisMouseButtonEventArgs>

MouseButtonUpDown

Occurs whenever a button on a mouse was pressed or released

event EventHandler<ArtemisMouseButtonUpDownEventArgs> MouseButtonUpDown

Event Type

EventHandler<ArtemisMouseButtonUpDownEventArgs>

MouseMove

Occurs whenever a a mouse is moved

event EventHandler<ArtemisMouseMoveEventArgs> MouseMove

Event Type

EventHandler<ArtemisMouseMoveEventArgs>

MouseScroll

Occurs whenever a the scroll wheel of a mouse is turned

event EventHandler<ArtemisMouseScrollEventArgs> MouseScroll

Event Type

EventHandler<ArtemisMouseScrollEventArgs>