OH_Input_AddInputEventInterceptor

Function OH_Input_AddInputEventInterceptor 

Source
pub unsafe extern "C" fn OH_Input_AddInputEventInterceptor(
    callback: *mut Input_InterceptorEventCallback,
    option: *mut Input_InterceptorOptions,
) -> Input_Result
Available on crate feature api-12 only.
Expand description

Adds an interceptor for input events, including mouse, touch, and axis events. If multiple interceptors are added, only the first one takes effect.

ohos.permission.INTERCEPT_INPUT_EVENT

§Arguments

  • callback - - Pointer to the structure of the callback for the input event interceptor. For details, see Input_InterceptorEventCallback.

  • option - - Options for event interception. If null is passed, the default value is used.

§Returns

  • OH_Input_AddInputEventInterceptor function result code. [INPUT_SUCCESS] Adds an interceptor for input events success.

[INPUT_PERMISSION_DENIED] Permission verification failed.

[INPUT_PARAMETER_ERROR] The callback is NULL.

[INPUT_REPEAT_INTERCEPTOR] Interceptor repeatedly created for an application.

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

Required System Capabilities: SystemCapability.MultimodalInput.Input.Core

Available since API-level: 12