Table of Contents

Interface ILunyInputService

Namespace
Luny.Engine.Services
Assembly
Luny.dll

Engine-agnostic input service providing event-driven and polling access to input actions.

public interface ILunyInputService : ILunyEngineService

Remarks

IMPORTANT: Implementations must inherit from both the ILunyInputService interface and its corresponding LunyInputServiceBase class!

Methods

AssignUserToLastDevice(string, int, ILunyObject)

void AssignUserToLastDevice(string userName, int deviceId, ILunyObject lunyObject)

Parameters

userName string
deviceId int
lunyObject ILunyObject

EnableInputAction(string, bool)

void EnableInputAction(string actionName, bool enabled)

Parameters

actionName string
enabled bool

GetAxis(string)

Gets the analog trigger value (0.0–1.0) for the named button action.

float GetAxis(string actionName)

Parameters

actionName string

Returns

float

GetButtonJustPressed(string)

True only on the frame the button transitioned to pressed.

bool GetButtonJustPressed(string actionName)

Parameters

actionName string

Returns

bool

GetButtonPressed(string)

True while button is held.

bool GetButtonPressed(string actionName)

Parameters

actionName string

Returns

bool

GetButtonStrength(string)

Returns a button's pressed strength. Used by triggers configured to act like buttons.

float GetButtonStrength(string actionName)

Parameters

actionName string

Returns

float

GetDirection(string)

Gets last known axis vector for the named action.

LunyVector2 GetDirection(string actionName)

Parameters

actionName string

Returns

LunyVector2

GetRotation(string)

Gets last known axis vector as rotation (quaternion). Assumes positive Y is up vector.

LunyQuaternion GetRotation(string actionName)

Parameters

actionName string

Returns

LunyQuaternion

GetRotation(string, LunyVector3)

Gets last known axis vector as rotation (quaternion) with custom up vector.

LunyQuaternion GetRotation(string actionName, LunyVector3 worldUp)

Parameters

actionName string
worldUp LunyVector3

Returns

LunyQuaternion

IsUserPairedWithDevice(string, int)

bool IsUserPairedWithDevice(string userName, int deviceId)

Parameters

userName string
deviceId int

Returns

bool

SetControlSchemes(params string[])

Activate a given control scheme eg Gamepad or Keyboard&Mouse to prevent other device input from coming through.

void SetControlSchemes(params string[] schemeNames)

Parameters

schemeNames string[]

UnassignUser(string)

void UnassignUser(string userName)

Parameters

userName string

Events

OnInputAction

Fired when any enabled action changes value.

event Action<LunyInputActionEvent> OnInputAction

Event Type

Action<LunyInputActionEvent>