From c8f64a86535e748369b0bbae81c34c7bca21a6ce Mon Sep 17 00:00:00 2001 From: w00416770 Date: Wed, 15 Jan 2025 17:19:15 +0800 Subject: [PATCH] =?UTF-8?q?Input=5FKeyEvent=E3=80=81Input=5FMouseEvent?= =?UTF-8?q?=E3=80=81Input=5FTouchEvent=E3=80=81Input=5FAxisEvent=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=AF=B9=E5=BA=94=E7=9A=84w=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kits/c/input/oh_input_manager.h | 172 ++++++++++++++++++ multimodalinput/kits/c/ohinput.ndk.json | 64 +++++++ 2 files changed, 236 insertions(+) diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 4976b4c2739..c159e55f123 100644 --- a/multimodalinput/kits/c/input/oh_input_manager.h +++ b/multimodalinput/kits/c/input/oh_input_manager.h @@ -540,6 +540,46 @@ void OH_Input_SetKeyEventActionTime(struct Input_KeyEvent* keyEvent, int64_t act */ int64_t OH_Input_GetKeyEventActionTime(const struct Input_KeyEvent* keyEvent); +/** + * @brief Sets the windowId for a key event. + * + * @param keyEvent Key event object. + * @param windowId The windowId for a key event. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 15 + */ +void OH_Input_SetKeyEventWindowId(struct Input_KeyEvent* keyEvent, int32_t windowId); + +/** + * @brief Obtains the windowId of a key event. + * + * @param keyEvent Key event object. + * @return windowId. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 15 + */ +int32_t OH_Input_GetKeyEventWindowId(const struct Input_KeyEvent* keyEvent); + +/** + * @brief Sets the displayId for a key event. + * + * @param keyEvent Key event object. + * @param displayId The displayId for a key event. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 15 + */ +void OH_Input_SetKeyEventDisplayId(struct Input_KeyEvent* keyEvent, int32_t displayId); + +/** + * @brief Obtains the displayId of a key event. + * + * @param keyEvent Key event object. + * @return displayId. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 15 + */ +int32_t OH_Input_GetKeyEventDisplayId(const struct Input_KeyEvent* keyEvent); + /** * @brief Inject mouse event. * @@ -713,6 +753,46 @@ void OH_Input_SetMouseEventActionTime(struct Input_MouseEvent* mouseEvent, int64 */ int64_t OH_Input_GetMouseEventActionTime(const struct Input_MouseEvent* mouseEvent); +/** + * @brief Sets the windowId for a mouse event. + * + * @param mouseEvent Mouse event object. + * @param windowId The windowId for a mouse event. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 15 + */ +void OH_Input_SetMouseEventWindowId(struct Input_MouseEvent* mouseEvent, int32_t windowId); + +/** + * @brief Obtains the windowId of a mouse event. + * + * @param mouseEvent Mouse event object. + * @return windowId. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 15 + */ +int32_t OH_Input_GetMouseEventWindowId(const struct Input_MouseEvent* mouseEvent); + +/** + * @brief Sets the displayId for a mouse event. + * + * @param mouseEvent Mouse event object. + * @param displayId The displayId for a mouse event. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 15 + */ +void OH_Input_SetMouseEventDisplayId(struct Input_MouseEvent* mouseEvent, int32_t displayId); + +/** + * @brief Obtains the displayId of a mouse event. + * + * @param mouseEvent Mouse event object. + * @return displayId. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 15 + */ +int32_t OH_Input_GetMouseEventDisplayId(const struct Input_MouseEvent* mouseEvent); + /** * @brief Inject touch event. * @@ -844,6 +924,46 @@ void OH_Input_SetTouchEventActionTime(struct Input_TouchEvent* touchEvent, int64 */ int64_t OH_Input_GetTouchEventActionTime(const struct Input_TouchEvent* touchEvent); +/** + * @brief Sets the windowId for a touch event. + * + * @param touchEvent Touch event object. + * @param windowId The windowId for a touch event. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 15 + */ +void OH_Input_SetTouchEventWindowId(struct Input_TouchEvent* touchEvent, int32_t windowId); + +/** + * @brief Obtains the windowId of a touch event. + * + * @param touchEvent Touch event object. + * @return windowId. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 15 +*/ +int32_t OH_Input_GetTouchEventWindowId(const struct Input_TouchEvent* touchEvent); + +/** + * @brief Sets the displayId for a touch event. + * + * @param touchEvent Touch event object. + * @param displayId The displayId for a touch event. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 15 + */ +void OH_Input_SetTouchEventDisplayId(struct Input_TouchEvent* touchEvent, int32_t displayId); + +/** + * @brief Obtains the displayId of a touch event. + * + * @param touchEvent Touch event object. + * @return displayId. + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 15 +*/ +int32_t OH_Input_GetTouchEventDisplayId(const struct Input_TouchEvent* touchEvent); + /** * @brief Cancels event injection and revokes authorization. * @@ -1061,6 +1181,58 @@ Input_Result OH_Input_SetAxisEventSourceType(Input_AxisEvent* axisEvent, InputEv */ Input_Result OH_Input_GetAxisEventSourceType(const Input_AxisEvent* axisEvent, InputEvent_SourceType* sourceType); +/** + * @brief Sets the windowId of an axis event. + * + * @param axisEvent Axis event object. For details, see {@Link Input_AxisEvent}. + * @param windowId The windowId for the axis event. + * @return OH_Input_SetAxisEventDisplayY function result code. + * {@link INPUT_SUCCESS} Sets the Y coordinate of the axis event success.\n + * {@link INPUT_PARAMETER_ERROR} The axisEvent is NULL.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 15 + */ +Input_Result OH_Input_SetAxisEventWindowId(Input_AxisEvent* axisEvent, int32_t windowId); + +/** + * @brief Obtains the windowId of an axis event. + * + * @param axisEvent Axis event object. For details, see {@Link Input_AxisEvent}. + * @param windowId The windowId for the axis event. + * @return OH_Input_GetAxisEventDisplayY function result code. + * {@link INPUT_SUCCESS} Obtains the Y coordinate of the axis event success.\n + * {@link INPUT_PARAMETER_ERROR} The axisEvent is NULL or the displayY is NULL.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 15 + */ +Input_Result OH_Input_GetAxisEventWindowId(const Input_AxisEvent* axisEvent, int32_t* windowId); + +/** + * @brief Sets the displayId of an axis event. + * + * @param axisEvent Axis event object. For details, see {@Link Input_AxisEvent}. + * @param displayId The displayId for the axis event. + * @return OH_Input_SetAxisEventDisplayY function result code. + * {@link INPUT_SUCCESS} Sets the Y coordinate of the axis event success.\n + * {@link INPUT_PARAMETER_ERROR} The axisEvent is NULL.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 15 + */ +Input_Result OH_Input_SetAxisEventDisplayId(Input_AxisEvent* axisEvent, int32_t displayId); + +/** + * @brief Obtains the displayId of an axis event. + * + * @param axisEvent Axis event object. For details, see {@Link Input_AxisEvent}. + * @param displayId The displayId for the axis event. + * @return OH_Input_GetAxisEventDisplayY function result code. + * {@link INPUT_SUCCESS} Obtains the Y coordinate of the axis event success.\n + * {@link INPUT_PARAMETER_ERROR} The axisEvent is NULL or the displayY is NULL.\n + * @syscap SystemCapability.MultimodalInput.Input.Core + * @since 15 + */ +Input_Result OH_Input_GetAxisEventDisplayId(const Input_AxisEvent* axisEvent, int32_t* displayId); + /** * @brief Adds a listener of key events. * diff --git a/multimodalinput/kits/c/ohinput.ndk.json b/multimodalinput/kits/c/ohinput.ndk.json index 1b92c991420..97daf216d56 100644 --- a/multimodalinput/kits/c/ohinput.ndk.json +++ b/multimodalinput/kits/c/ohinput.ndk.json @@ -430,5 +430,69 @@ { "first_introduced": "13", "name": "OH_Input_UnregisterDeviceListeners" + }, + { + "first_introduced": "15", + "name": "OH_Input_SetKeyEventWindowId" + }, + { + "first_introduced": "15", + "name": "OH_Input_GetKeyEventWindowId" + }, + { + "first_introduced": "15", + "name": "OH_Input_SetKeyEventDisplayId" + }, + { + "first_introduced": "15", + "name": "OH_Input_GetKeyEventDisplayId" + }, + { + "first_introduced": "15", + "name": "OH_Input_SetMouseEventWindowId" + }, + { + "first_introduced": "15", + "name": "OH_Input_GetMouseEventWindowId" + }, + { + "first_introduced": "15", + "name": "OH_Input_SetMouseEventDisplayId" + }, + { + "first_introduced": "15", + "name": "OH_Input_GetMouseEventDisplayId" + }, + { + "first_introduced": "15", + "name": "OH_Input_SetTouchEventWindowId" + }, + { + "first_introduced": "15", + "name": "OH_Input_GetTouchEventWindowId" + }, + { + "first_introduced": "15", + "name": "OH_Input_SetTouchEventDisplayId" + }, + { + "first_introduced": "15", + "name": "OH_Input_GetTouchEventDisplayId" + }, + { + "first_introduced": "15", + "name": "OH_Input_SetAxisEventWindowId" + }, + { + "first_introduced": "15", + "name": "OH_Input_GetAxisEventWindowId" + }, + { + "first_introduced": "15", + "name": "OH_Input_SetAxisEventDisplayId" + }, + { + "first_introduced": "15", + "name": "OH_Input_GetAxisEventDisplayId" } ] -- Gitee