From e3cf145e429c8be4cbf37de3ea46bcea210efc12 Mon Sep 17 00:00:00 2001 From: hct95 Date: Mon, 6 Jan 2025 20:32:46 +0800 Subject: [PATCH] add operate hand info in touchEvent Signed-off-by: hct95 --- arkui/ace_engine/native/ui_input_event.h | 40 ++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/arkui/ace_engine/native/ui_input_event.h b/arkui/ace_engine/native/ui_input_event.h index 503f6f8ca..f23c2dba5 100644 --- a/arkui/ace_engine/native/ui_input_event.h +++ b/arkui/ace_engine/native/ui_input_event.h @@ -224,6 +224,20 @@ enum { UI_FOCUS_AXIS_EVENT_ABS_HAT0Y = 7, }; +/** + * @brief Defines interaction hand for touch event. + * + * @since 16 + */ +typedef enum { + /** None. */ + HAND_NONE = 0, + /** Left hand. */ + HAND_LEFT = 1, + /** Right hand. */ + HAND_RIGHT = 2, +} InteractionHand; + /** * @brief Obtains the type of this UI input event. * @@ -480,6 +494,32 @@ float OH_ArkUI_PointerEvent_GetTouchAreaWidth(const ArkUI_UIInputEvent* event, u */ float OH_ArkUI_PointerEvent_GetTouchAreaHeight(const ArkUI_UIInputEvent* event, uint32_t pointerIndex); +/** + * @brief Obtains the interaction hand of a touch point. + * + * @param event Indicates the pointer to the current UI input event. + * @param hand Indicates the interaction hand of a touch point. + * @return Returns the result code. + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. + * @since 16 + */ +int32_t OH_ArkUI_PointerEvent_GetInteractionHand(const ArkUI_UIInputEvent *event, InteractionHand *hand); + +/** + * @brief Obtains the interaction hand of a touch point. + * + * @param event Indicates the pointer to the current UI input event. + * @param pointerIndex Indicates the index of the target touch point in the multi-touch data list. + * @param hand Indicates the interaction hand of a touch point. + * @return Returns the result code. + * Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + * Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. + * @since 16 + */ +int32_t OH_ArkUI_PointerEvent_GetInteractionHandByIdx( + const ArkUI_UIInputEvent *event, int32_t pointerIndex, InteractionHand *hand); + /** * @brief Obtains the number of historical events from a directional input event (such as a touch event, mouse event, * or axis event). -- Gitee