Skip to main content

OH_Input_AddMouseEventMonitor

Function OH_Input_AddMouseEventMonitor 

Source
pub unsafe extern "C" fn OH_Input_AddMouseEventMonitor(
    callback: Input_MouseEventCallback,
) -> Input_Result
Expand description

@brief Adds a listener for mouse events, including mouse click and movement events, but not scroll wheel events. Scroll wheel events are axis events.
This API can be called only when the screen recording scenario is in use. Otherwise, the call does not take effect.

@permission ohos.permission.INPUT_MONITORING @param callback Callback used to receive mouse events. @return {@link INPUT_SUCCESS} if the operation is successful; {@link INPUT_PERMISSION_DENIED} if permission verification fails;
{@link INPUT_PARAMETER_ERROR} if the callback is empty; {@link INPUT_SERVICE_EXCEPTION} if the service is abnormal. @syscap SystemCapability.MultimodalInput.Input.Core @since 12