Skip to main content
Version: 12 Dec 2024

MLInputControllerCallbacksEx

Module: Input

A structure containing callbacks for input controller events. More...

#include <ml_input.h>

Public Attributes

TypeName
uint32_tversion
void()(uint8_t controller_id, const MLInputControllerTouchpadGesture touchpad_gesture, void *data)on_touchpad_gesture
This callback will be invoked whenever a touch gesture is detected. This callback will be called for both discrete and continuous gestures.
void()(uint8_t controller_id, const MLInputControllerTouchpadGesture touchpad_gesture, void *data)on_touchpad_gesture_continue
This callback will be invoked whenever a continuation of a touch gesture is detected. This callback will be called only for continuous gestures.
void()(uint8_t controller_id, const MLInputControllerTouchpadGesture touchpad_gesture, void *data)on_touchpad_gesture_end
This callback will be invoked whenever a continuous touch gesture ends. This callback will be called only for continuous gestures.
void()(uint8_t controller_id, MLInputControllerButton button, void data)on_button_down
This callback will be invoked whenever a controller button is pressed. This callback will be called only for discrete gestures.
void()(uint8_t controller_id, MLInputControllerButton button, void data)on_button_up
This callback will be invoked whenever a controller button is released.
void()(uint8_t controller_id, MLInputControllerButton button, void data)on_button_click
This callback will be invoked whenever a controller button is pressed and released within a short duration.
void()(uint8_t controller_id, MLInputControllerTriggerEvent event, float depth, void data)on_trigger
This callback will be invoked whenever a controller trigger state is changed.
void()(uint8_t controller_id, void data)on_connect
This callback will be invoked whenever a controller is connected.
void()(uint8_t controller_id, void data)on_disconnect
This callback will be invoked whenever a controller is disconnected.

Detailed Description

struct MLInputControllerCallbacksEx;

A 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.

API Level:

  • 20

Public Attributes Documentation

version

uint32_t version;

Version of this structure.


on_touchpad_gesture

void(*)(uint8_t controller_id, const MLInputControllerTouchpadGesture *touchpad_gesture, void *data) on_touchpad_gesture;

This callback will be invoked whenever a touch gesture is detected. This callback will be called for both discrete and continuous gestures.

TypeDescription
void()(uint8_t controller_id, const MLInputControllerTouchpadGesture touchpad_gesture, void *data))(uint8_t controller_id, const MLInputControllerTouchpadGesture touchpad_gesture, void data)

Parameters

controller_idId of the controller.
touchpad_gesturePointer to the struct containing state of the controller.
dataUser data as passed to MLInputSetControllerCallbacksEx().

on_touchpad_gesture_continue

void(*)(uint8_t controller_id, const MLInputControllerTouchpadGesture *touchpad_gesture, void *data) on_touchpad_gesture_continue;

This callback will be invoked whenever a continuation of a touch gesture is detected. This callback will be called only for continuous gestures.

TypeDescription
void()(uint8_t controller_id, const MLInputControllerTouchpadGesture touchpad_gesture, void *data))(uint8_t controller_id, const MLInputControllerTouchpadGesture touchpad_gesture, void data)

Parameters

controller_idId of the controller.
touchpad_gesturePointer to the struct containing state of the controller.
dataUser data as passed to MLInputSetControllerCallbacksEx().

on_touchpad_gesture_end

void(*)(uint8_t controller_id, const MLInputControllerTouchpadGesture *touchpad_gesture, void *data) on_touchpad_gesture_end;

This callback will be invoked whenever a continuous touch gesture ends. This callback will be called only for continuous gestures.

TypeDescription
void()(uint8_t controller_id, const MLInputControllerTouchpadGesture touchpad_gesture, void *data))(uint8_t controller_id, const MLInputControllerTouchpadGesture touchpad_gesture, void data)

Parameters

controller_idId of the controller.
touchpad_gesturePointer to the struct containing state of the controller.
dataUser data as passed to MLInputSetControllerCallbacksEx().

on_button_down

void(*)(uint8_t controller_id, MLInputControllerButton button, void *data) on_button_down;

This callback will be invoked whenever a controller button is pressed. This callback will be called only for discrete gestures.

TypeDescription
void()(uint8_t controller_id, MLInputControllerButton button, void data))(uint8_t controller_id, MLInputControllerButton button, void *data)

Parameters

controller_idId of the controller.
buttonValue of the controller button.
dataUser data as passed to MLInputSetControllerCallbacksEx().

on_button_up

void(*)(uint8_t controller_id, MLInputControllerButton button, void *data) on_button_up;

This callback will be invoked whenever a controller button is released.

TypeDescription
void()(uint8_t controller_id, MLInputControllerButton button, void data))(uint8_t controller_id, MLInputControllerButton button, void *data)

Parameters

controller_idId of the controller.
buttonValue of the controller button.
dataUser data as passed to MLInputSetControllerCallbacksEx().

on_button_click

void(*)(uint8_t controller_id, MLInputControllerButton button, void *data) on_button_click;

This callback will be invoked whenever a controller button is pressed and released within a short duration.

TypeDescription
void()(uint8_t controller_id, MLInputControllerButton button, void data))(uint8_t controller_id, MLInputControllerButton button, void *data)

Parameters

controller_idId of the controller.
buttonValue of the controller button.
dataUser data as passed to MLInputSetControllerCallbacksEx().

on_trigger

void(*)(uint8_t controller_id, MLInputControllerTriggerEvent event, float depth, void *data) on_trigger;

This callback will be invoked whenever a controller trigger state is changed.

TypeDescription
void()(uint8_t controller_id, MLInputControllerTriggerEvent event, float depth, void data))(uint8_t controller_id, MLInputControllerTriggerEvent event, float depth, void *data)

Parameters

controller_idId of the controller.
eventValue of the trigger event.
depthNormalized value of trigger pressing (0.0 ~ 1.0)
dataUser data as passed to MLInputSetControllerCallbacksEx().

on_connect

void(*)(uint8_t controller_id, void *data) on_connect;

This callback will be invoked whenever a controller is connected.

TypeDescription
void()(uint8_t controller_id, void data))(uint8_t controller_id, void *data)

Parameters

controller_idId of the controller.
dataUser data as passed to MLInputSetControllerCallbacksEx().

on_disconnect

void(*)(uint8_t controller_id, void *data) on_disconnect;

This callback will be invoked whenever a controller is disconnected.

TypeDescription
void()(uint8_t controller_id, void data))(uint8_t controller_id, void *data)

Parameters

controller_idId of the controller.
dataUser data as passed to MLInputSetControllerCallbacksEx().