OH_Input_AddMouseEventMonitor

Function OH_Input_AddMouseEventMonitor 

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

Adds a listener for mouse events, including mouse click and movement events, but not scroll wheel events. Scroll wheel events are axis events.

ohos.permission.INPUT_MONITORING

§Arguments

  • callback - - Callback used to receive mouse events.

§Returns

  • OH_Input_AddMouseEventMonitor function result code. [INPUT_SUCCESS] Adds a listener of mouse 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