diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index ae72b476fd83a1265d6d5b1663a7e4db011ea55f..8f13608c45154c044cffab0ea8494aedd6ebf7fd 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -304,6 +304,16 @@ typedef enum Input_Result { * @since 20 */ INPUT_INJECTION_AUTHORIZED_OTHERS = 3900008, + /** + * @error The app is not the focused app + * @since 20 + */ + INPUT_APP_NOT_FOCUSED = 3900009, + /** + * @error The device has no pointer + * @since 20 + */ + INPUT_DEVICE_NO_POINTER = 3900010, } Input_Result; /** @@ -1050,6 +1060,23 @@ Input_Result OH_Input_RequestInjection(Input_InjectAuthorizeCallback callback); Input_Result OH_Input_QueryAuthorizedStatus(Input_InjectionStatus* status); +/** +* @brief get pointer location. +* +* @param displayId The displayId for the pointer location. +* @param displayX The displayX for the pointer location. +* @param displayY The displayY for the pointer location. +* @return OH_Input_GetPointerLocation function api result code +* {@link INPUT_SUCCESS} if the operation is successful; +* {@link INPUT_PARAMETER_ERROR} if parameter is a null pointer; +* {@link INPUT_APP_NOT_FOCUSED} if the app is not the focused app; +* {@link INPUT_DEVICE_NO_POINTER} if the device has no pointer; +* {@link INPUT_SERVICE_EXCEPTION} if the service is exception. +* @syscap SystemCapability.MultimodalInput.Input.Core +* @since 20 +*/ +Input_Result OH_Input_GetPointerLocation(int32_t* displayId, double* displayX, double* displayY); + /** * @brief Creates an axis event object. *