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
Expand Details ...

Remarks

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

Methods

AssignUserToLastDevice(String, Int32, ILunyObject)

void AssignUserToLastDevice(String userName, Int32 deviceId, ILunyObject lunyObject)

Parameters

Type Name Description
String
userName
Int32
deviceId
ILunyObject
lunyObject

EnableInputAction(String, Boolean)

void EnableInputAction(String actionName, Boolean enable)

Parameters

Type Name Description
String
actionName
Boolean
enable

GetAxis(String)

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

Single GetAxis(String actionName)

Parameters

Type Name Description
String
actionName

Returns

Single

GetButtonJustPressed(String)

True only on the frame the button transitioned to pressed.

Boolean GetButtonJustPressed(String actionName)

Parameters

Type Name Description
String
actionName

Returns

Boolean

GetButtonPressed(String)

True while button is held.

Boolean GetButtonPressed(String actionName)

Parameters

Type Name Description
String
actionName

Returns

Boolean

GetButtonStrength(String)

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

Single GetButtonStrength(String actionName)

Parameters

Type Name Description
String
actionName

Returns

Single

GetDirection(String)

Gets last known axis vector for the named action.

LunyVector2 GetDirection(String actionName)

Parameters

Type Name Description
String
actionName

Returns

LunyVector2

GetRotation(String)

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

LunyQuaternion GetRotation(String actionName)

Parameters

Type Name Description
String
actionName

Returns

LunyQuaternion

GetRotation(String, LunyVector3)

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

LunyQuaternion GetRotation(String actionName, LunyVector3 worldUp)

Parameters

Type Name Description
String
actionName
LunyVector3
worldUp

Returns

LunyQuaternion

IsUserPairedWithDevice(String, Int32)

Boolean IsUserPairedWithDevice(String userName, Int32 deviceId)

Parameters

Type Name Description
String
userName
Int32
deviceId

Returns

Boolean

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

Type Name Description
String[]
schemeNames

UnassignUser(String)

void UnassignUser(String userName)

Parameters

Type Name Description
String
userName

Events

OnInputAction

Fired when any enabled action changes value.

event Action<LunyInputActionEvent> OnInputAction

Event Type

Action<LunyInputActionEvent>