MLInputControllerCallbacksEx
Module: Input
A structure containing callbacks for input controller events. More...
#include <ml_input.h>
Public Attributes
Type | Name |
---|---|
uint32_t | version |
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.
Type | Description |
---|---|
void()(uint8_t controller_id, const MLInputControllerTouchpadGesture touchpad_gesture, void *data) | )(uint8_t controller_id, const MLInputControllerTouchpadGesture touchpad_gesture, void data) |
Parameters
controller_id | Id of the controller. | |
touchpad_gesture | Pointer to the struct containing state of the controller. | |
data | User 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.
Type | Description |
---|---|
void()(uint8_t controller_id, const MLInputControllerTouchpadGesture touchpad_gesture, void *data) | )(uint8_t controller_id, const MLInputControllerTouchpadGesture touchpad_gesture, void data) |
Parameters
controller_id | Id of the controller. | |
touchpad_gesture | Pointer to the struct containing state of the controller. | |
data | User 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.
Type | Description |
---|---|
void()(uint8_t controller_id, const MLInputControllerTouchpadGesture touchpad_gesture, void *data) | )(uint8_t controller_id, const MLInputControllerTouchpadGesture touchpad_gesture, void data) |
Parameters
controller_id | Id of the controller. | |
touchpad_gesture | Pointer to the struct containing state of the controller. | |
data | User 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.
Type | Description |
---|---|
void()(uint8_t controller_id, MLInputControllerButton button, void data) | )(uint8_t controller_id, MLInputControllerButton button, void *data) |
Parameters
controller_id | Id of the controller. | |
button | Value of the controller button. | |
data | User 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.
Type | Description |
---|---|
void()(uint8_t controller_id, MLInputControllerButton button, void data) | )(uint8_t controller_id, MLInputControllerButton button, void *data) |
Parameters
controller_id | Id of the controller. | |
button | Value of the controller button. | |
data | User 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.
Type | Description |
---|---|
void()(uint8_t controller_id, MLInputControllerButton button, void data) | )(uint8_t controller_id, MLInputControllerButton button, void *data) |
Parameters
controller_id | Id of the controller. | |
button | Value of the controller button. | |
data | User 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.
Type | Description |
---|---|
void()(uint8_t controller_id, MLInputControllerTriggerEvent event, float depth, void data) | )(uint8_t controller_id, MLInputControllerTriggerEvent event, float depth, void *data) |
Parameters
controller_id | Id of the controller. | |
event | Value of the trigger event. | |
depth | Normalized value of trigger pressing (0.0 ~ 1.0) | |
data | User 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.
Type | Description |
---|---|
void()(uint8_t controller_id, void data) | )(uint8_t controller_id, void *data) |
Parameters
controller_id | Id of the controller. | |
data | User 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.
Type | Description |
---|---|
void()(uint8_t controller_id, void data) | )(uint8_t controller_id, void *data) |
Parameters
controller_id | Id of the controller. | |
data | User data as passed to MLInputSetControllerCallbacksEx(). |