From 032c48fdae6c2b44dc2b125d6b96a0f7b01beafc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=83=96=E5=AD=90?= <390530071@qq.com> Date: Fri, 20 Jun 2025 11:32:16 +0800 Subject: [PATCH] add new API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 小胖子 <390530071@qq.com> --- .../kits/c/input/oh_input_manager.h | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index ae72b476f..8f13608c4 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. * -- Gitee