From 579d1fdb1ab99f3ca2fb9c91800656ea1205c67f Mon Sep 17 00:00:00 2001 From: benb365 Date: Wed, 26 Mar 2025 10:17:54 +0800 Subject: [PATCH] Add keyboard indicator states in KeyEvent. Signed-off-by: benb365 Change-Id: Iea0ff5cd2cf2b577f67f09980dfa3f946da88127 --- arkui/ace_engine/native/native_key_event.h | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/arkui/ace_engine/native/native_key_event.h b/arkui/ace_engine/native/native_key_event.h index a20f0e9b5..9a4840835 100644 --- a/arkui/ace_engine/native/native_key_event.h +++ b/arkui/ace_engine/native/native_key_event.h @@ -500,6 +500,42 @@ ArkUI_KeyEventType OH_ArkUI_KeyEvent_GetType(const ArkUI_UIInputEvent* event); */ int32_t OH_ArkUI_KeyEvent_GetKeyCode(const ArkUI_UIInputEvent* event); +/** + * @brief Get the Num Lock state of the key event. + * + * @param event Pointer to an ArkUI_UIInputEvent object. + * @param state Return whether the Num Lock is on. + * @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 error occurs. + * @since 18 + */ +ArkUI_ErrorCode OH_ArkUI_KeyEvent_IsNumLockOn(const ArkUI_UIInputEvent* event, bool* state); + +/** + * @brief Get the Caps Lock state of the key event. + * + * @param event Pointer to an ArkUI_UIInputEvent object. + * @param state Return whether the Caps Lock is on. + * @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 error occurs. + * @since 18 + */ +ArkUI_ErrorCode OH_ArkUI_KeyEvent_IsCapsLockOn(const ArkUI_UIInputEvent* event, bool* state); + +/** + * @brief Get the Scroll Lock state of the key event. + * + * @param event Pointer to an ArkUI_UIInputEvent object. + * @param state Return whether the Scroll Lock is on. + * @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 error occurs. + * @since 18 + */ +ArkUI_ErrorCode OH_ArkUI_KeyEvent_IsScrollLockOn(const ArkUI_UIInputEvent* event, bool* state); + /** * @brief Obtains the key value from a key event. * -- Gitee