OH_NativeXComponent_RegisterKeyEventCallbackWithResult

Function OH_NativeXComponent_RegisterKeyEventCallbackWithResult 

Source
pub unsafe extern "C" fn OH_NativeXComponent_RegisterKeyEventCallbackWithResult(
    component: *mut OH_NativeXComponent,
    callback: Option<unsafe extern "C" fn(component: *mut OH_NativeXComponent, window: *mut c_void) -> bool>,
) -> i32
Available on crate feature api-14 only.
Expand description

Registers a callback for this OH_NativeXComponent instance.

§Arguments

  • component - Indicates the pointer to this OH_NativeXComponent instance.

  • callback - Indicates the pointer to a key event callback with result.

§Returns

  • Returns the status code of the execution. [OH_NATIVEXCOMPONENT_RESULT_SUCCESS] the callback function is successfully registered.

[OH_NATIVEXCOMPONENT_RESULT_BAD_PARAMETER] component is nullptr or callback is nullptr.

Available since API-level: 14

Version: 1.0