mirror of
https://gitee.com/openharmony/interface_sdk_c
synced 2024-11-23 14:50:20 +00:00
System shortcut key capi interface
Signed-off-by: hellohyh001 <huiyuehong@huawei.com> Change-Id: Iaf5a3935b13ef855b180317305f0ead886fe0f04
This commit is contained in:
parent
9b40d0721a
commit
e89e3317cd
@ -208,6 +208,13 @@ typedef struct Input_TouchEvent Input_TouchEvent;
|
||||
*/
|
||||
typedef struct Input_AxisEvent Input_AxisEvent;
|
||||
|
||||
/**
|
||||
* @brief Defines the hot key structure.
|
||||
*
|
||||
* @since 13
|
||||
*/
|
||||
typedef struct Input_Hotkey Input_Hotkey;
|
||||
|
||||
/**
|
||||
* @brief Enumerates error codes.
|
||||
*
|
||||
@ -1214,6 +1221,113 @@ Input_Result OH_Input_RemoveInputEventInterceptor(void);
|
||||
*/
|
||||
Input_Result OH_Input_GetIntervalSinceLastInput(int64_t *timeInterval);
|
||||
|
||||
/**
|
||||
* @brief Creates a hot key object.
|
||||
*
|
||||
* @return Returns an {@Link Input_Hotkey} pointer object if the operation is successful. Otherwise, a null pointer is
|
||||
* returned. The possible cause is memory allocation failure.
|
||||
* @syscap SystemCapability.MultimodalInput.Input.Core
|
||||
* @since 13
|
||||
*/
|
||||
Input_Hotkey *OH_Input_CreateHotkey(void);
|
||||
|
||||
/**
|
||||
* @brief Destroys a hot key object.
|
||||
*
|
||||
* @param hotkey Hot key object.
|
||||
* @syscap SystemCapability.MultimodalInput.Input.Core
|
||||
* @since 13
|
||||
*/
|
||||
void OH_Input_DestroyHotkey(Input_Hotkey **hotkey);
|
||||
|
||||
/**
|
||||
* @brief Sets a modifier key.
|
||||
*
|
||||
* @param hotkey Hotkey key object.
|
||||
* @param preKeys List of modifier keys.
|
||||
* @param size Number of modifier keys. One or two modifier keys are supported.
|
||||
* @syscap SystemCapability.MultimodalInput.Input.Core
|
||||
* @since 13
|
||||
*/
|
||||
void OH_Input_SetPreKeys(Input_Hotkey *hotkey, int32_t *preKeys, int32_t size);
|
||||
|
||||
/**
|
||||
* @brief Obtains a modifier key.
|
||||
*
|
||||
* @param hotkey Hotkey key object.
|
||||
* @param preKeys List of modifier keys.
|
||||
* @param preKeyCount Number of modifier keys.
|
||||
* @return OH_Input_GetPreKeys status code, specifically,
|
||||
* {@link INPUT_SUCCESS} if the operation is successful;\n
|
||||
* {@link INPUT_PARAMETER_ERROR} The hotkey is NULL or the pressedKeys is NULL or the pressedKeyCount
|
||||
* is NULL.\n
|
||||
* @syscap SystemCapability.MultimodalInput.Input.Core
|
||||
* @since 13
|
||||
*/
|
||||
Input_Result OH_Input_GetPreKeys(const Input_Hotkey *hotkey, int32_t **preKeys, int32_t *preKeyCount);
|
||||
|
||||
/**
|
||||
* @brief Sets a modified key.
|
||||
*
|
||||
* @param hotkey Hotkey key object.
|
||||
* @param finalKey Modified key. Only one modified key is supported.
|
||||
* @syscap SystemCapability.MultimodalInput.Input.Core
|
||||
* @since 13
|
||||
*/
|
||||
void OH_Input_SetFinalKey(Input_Hotkey *hotkey, int32_t finalKey);
|
||||
|
||||
/**
|
||||
* @brief Obtains a modified key.
|
||||
*
|
||||
* @param hotkey Hotkey key object.
|
||||
* @param finalKeyCode Returns the key value of the decorated key.
|
||||
* @return OH_Input_GetfinalKey status code, specifically,
|
||||
* {@link INPUT_SUCCESS} if the operation is successful;\n
|
||||
* {@link INPUT_PARAMETER_ERROR} The hotkey is NULL or the finalKeyCode is NULL.\n
|
||||
* @syscap SystemCapability.MultimodalInput.Input.Core
|
||||
* @since 13
|
||||
*/
|
||||
Input_Result OH_Input_GetFinalKey(const Input_Hotkey *hotkey, int32_t *finalKeyCode);
|
||||
|
||||
/**
|
||||
* @brief Creates an array of {@Link Input_Hotkey} instances.
|
||||
*
|
||||
* @param count Number of {@Link Input_Hotkey} instances to be created. The count must be the same as the number of
|
||||
* system shortcut keys.
|
||||
* @return Returns a pointer to an array of {@Link Input_Hotkey} instances if the operation is successful. If the
|
||||
* operation fails, a null pointer is returned. The possible cause is memory allocation failure or count is not equal
|
||||
* to the number of system hotkeys.
|
||||
* @syscap SystemCapability.MultimodalInput.Input.Core
|
||||
* @since 13
|
||||
*/
|
||||
Input_Hotkey **OH_Input_CreateAllSystemHotkeys(int32_t count);
|
||||
|
||||
/**
|
||||
* @brief Destroys an array of {@link Input_Hotkey} instances and reclaims memory.
|
||||
*
|
||||
* @param hotkeys Pointer to an array of {@Link Input_Hotkey } instances created by the
|
||||
* {@Link OH_Input_CreateAllSystemHotkeys} method.
|
||||
* @param count Count of the array to be destroyed, which must be the same as the number of system shortcut keys.
|
||||
* @syscap SystemCapability.MultimodalInput.Input.Core
|
||||
* @since 13
|
||||
*/
|
||||
void OH_Input_DestroyAllSystemHotkeys(Input_Hotkey **hotkeys, int32_t count);
|
||||
|
||||
/**
|
||||
* @brief Obtains all hot keys supported by the system.
|
||||
*
|
||||
* @param hotkey Array of {@Link Input_Hotkey} instances.
|
||||
* When calling this API for the first time, you can pass NULL to obtain the array length.
|
||||
* @param count Number of hot keys supported by the system.
|
||||
* @return OH_Input_GetAllSystemHotkeys status code, specifically,
|
||||
* {@link INPUT_SUCCESS} if the operation is successful;\n
|
||||
* {@link INPUT_PARAMETER_ERROR} The hotkey or count is NULL, or the value of count does not match the number
|
||||
* of system shortcut keys supported by the system.
|
||||
* @syscap SystemCapability.MultimodalInput.Input.Core
|
||||
* @since 13
|
||||
*/
|
||||
Input_Result OH_Input_GetAllSystemHotkeys(Input_Hotkey **hotkey, int32_t *count);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -314,5 +314,45 @@
|
||||
{
|
||||
"first_introduced": "12",
|
||||
"name": "OH_Input_RemoveInputEventInterceptor"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_Input_GetIntervalSinceLastInput"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_Input_CreateAllSystemHotkeys"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_Input_DestroyAllSystemHotkeys"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_Input_GetAllSystemHotkeys"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_Input_CreateHotkey"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_Input_DestroyHotkey"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_Input_SetPreKeys"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_Input_GetPreKeys"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_Input_SetFinalKey"
|
||||
},
|
||||
{
|
||||
"first_introduced": "13",
|
||||
"name": "OH_Input_GetFinalKey"
|
||||
}
|
||||
]
|
Loading…
Reference in New Issue
Block a user