Skip to main content
Version: 12 Dec 2024

NativeBindings

Inherits from:
MagicLeapNativeBindings

Public Methods

MLResult.Code MLInputGetConnectedDevices

Gets the device IDs of all connected devices.

public MLResult.Code MLInputGetConnectedDevices(
ulong Handle,
IntPtr InoutDevices
)

Parameters

TypeNameDescription
ulongHandle
IntPtrInoutDevices

MLResult.Code MLInputReleaseConnectedDevicesList

Releases the contents of #MLInputConnectedDevicesList populated by #MLInputGetConnectedDevices.

public MLResult.Code MLInputReleaseConnectedDevicesList(
ulong Handle,
IntPtr Devices
)

Parameters

TypeNameDescription
ulongHandle
IntPtrDevices

MLResult.Code MLInputSetControllerCallbacksEx

Sets the callbacks for controller input events.

public MLResult.Code MLInputSetControllerCallbacksEx(
ulong Handle,
ref MLInputControllerCallbacksEx Callbacks,
IntPtr UserData
)

Parameters

TypeNameDescription
ulongHandle
ref MLInputControllerCallbacksExCallbacksA structure containing callbacks for input controller events. The final parameter to all the callbacks is a void *, which will point to whatever payload data the user provides in MLInputSetControllerCallbacksEx. Individual callbacks which are not required by the client can be NULL. This structure must be initialized by calling MLInputControllerCallbacksExInit() before use.
IntPtrUserData

delegate void OnButtonClickDelegate

Callback structure for NativeBindings.OnButtonClick.

public delegate void OnButtonClickDelegate(
ushort controllerId,
MLInputControllerButton button,
IntPtr data
)

Parameters

TypeNameDescription
ushortcontrollerId
MLInputControllerButtonbutton
IntPtrdata

delegate void OnButtonDownDelegate

Callback structure for NativeBindings.OnButtonDown.

public delegate void OnButtonDownDelegate(
ushort controllerId,
MLInputControllerButton button,
IntPtr data
)

Parameters

TypeNameDescription
ushortcontrollerId
MLInputControllerButtonbutton
IntPtrdata

delegate void OnButtonUpDelegate

Callback structure for NativeBindings.OnButtonUp.

public delegate void OnButtonUpDelegate(
ushort controllerId,
MLInputControllerButton button,
IntPtr data
)

Parameters

TypeNameDescription
ushortcontrollerId
MLInputControllerButtonbutton
IntPtrdata

delegate void OnConnectDelegate

Callback structure for NativeBindings.OnConnect.

public delegate void OnConnectDelegate(
ushort controllerId,
IntPtr data
)

Parameters

TypeNameDescription
ushortcontrollerId
IntPtrdata

delegate void OnDisconnectDelegate

Callback structure for NativeBindings.OnDisconnect.

public delegate void OnDisconnectDelegate(
ushort controllerId,
IntPtr data
)

Parameters

TypeNameDescription
ushortcontrollerId
IntPtrdata

delegate void OnTouchpadGestureContinueDelegate

Callback structure for NativeBindings.OnTouchpadGestureContinue.

public delegate void OnTouchpadGestureContinueDelegate(
ushort controllerId,
IntPtr touchpadGesture,
IntPtr data
)

Parameters

TypeNameDescription
ushortcontrollerId
IntPtrtouchpadGesture
IntPtrdata

delegate void OnTouchpadGestureDelegate

Callback structure for NativeBindings.OnTouchpadGesture.

public delegate void OnTouchpadGestureDelegate(
ushort controllerId,
IntPtr touchpadGesture,
IntPtr data
)

Parameters

TypeNameDescription
ushortcontrollerId
IntPtrtouchpadGesture
IntPtrdata

delegate void OnTouchpadGestureEndDelegate

Callback structure for NativeBindings.OnTouchpadGestureEnd.

public delegate void OnTouchpadGestureEndDelegate(
ushort controllerId,
IntPtr touchpadGesture,
IntPtr data
)

Parameters

TypeNameDescription
ushortcontrollerId
IntPtrtouchpadGesture
IntPtrdata

delegate void OnTriggerDelegate

Callback structure for NativeBindings.OnTrigger.

public delegate void OnTriggerDelegate(
ushort controllerId,
MLInputControllerTriggerEvent @ event,
float depth,
IntPtr data
)

Parameters

TypeNameDescription
ushortcontrollerId
MLInputControllerTriggerEvent @eventTrigger events types.
floatdepth
IntPtrdata