OH_NativeXComponent_RegisterUIInputEventCallback

Function OH_NativeXComponent_RegisterUIInputEventCallback 

Source
pub unsafe extern "C" fn OH_NativeXComponent_RegisterUIInputEventCallback(
    component: *mut OH_NativeXComponent,
    callback: Option<unsafe extern "C" fn(component: *mut OH_NativeXComponent, event: *mut ArkUI_UIInputEvent, type_: ArkUI_UIInputEvent_Type)>,
    type_: ArkUI_UIInputEvent_Type,
) -> i32
Available on crate feature api-12 only.
Expand description

Registers a UI input event callback for an OH_NativeXComponent instance and enables the callback to be invoked when a UI input event is received. Currently, only axis events are supported.

§Arguments

  • component - Indicates the pointer to the OH_NativeXComponent instance.

  • callback - Indicates the pointer to the UI input event callback.

  • type - Indicates the type of the current UI input event.

§Returns

  • Returns the error code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs.

Available since API-level: 12