OH_Input_AddAxisEventMonitor

Function OH_Input_AddAxisEventMonitor 

Source
pub unsafe extern "C" fn OH_Input_AddAxisEventMonitor(
    axisEventType: InputEvent_AxisEventType,
    callback: Input_AxisEventCallback,
) -> Input_Result
Available on crate feature api-12 only.
Expand description

Adds a listener for the specified type of axis events.

ohos.permission.INPUT_MONITORING

§Arguments

  • axisEventType - - Axis event type. The values are defined in InputEvent_AxisEventType.

  • callback - - Callback used to receive the specified type of axis events.

§Returns

  • OH_Input_AddAxisEventMonitor function result code. [INPUT_SUCCESS] Adds a listener for the specified types of axis events success.

[INPUT_PERMISSION_DENIED] Permission verification failed.

[INPUT_PARAMETER_ERROR] The callback is NULL.

[INPUT_SERVICE_EXCEPTION] Failed to add the monitor because the service is exception.

Required System Capabilities: SystemCapability.MultimodalInput.Input.Core

Available since API-level: 12