diff --git a/multimodalinput/kits/c/input/oh_input_manager.h b/multimodalinput/kits/c/input/oh_input_manager.h index 4976b4c2739ee2dd4f145f86032cddebf4812b1f..c159e55f123f7e83e6629a7d65d023b9fb04204f 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 1b92c991420cd22affa967eb394d5487044bdc43..97daf216d567b8f4b378b63ce41b423ce469cecc 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" } ]