OH_ArkUI_UIInputEvent_GetPressedKeys

Function OH_ArkUI_UIInputEvent_GetPressedKeys 

Source
pub unsafe extern "C" fn OH_ArkUI_UIInputEvent_GetPressedKeys(
    event: *const ArkUI_UIInputEvent,
    pressedKeyCodes: *mut i32,
    length: *mut i32,
) -> i32
Available on crate features api-12 and api-14 only.
Expand description

Obtains all keys that are pressed from UI input event. Only supports key events currently.

§Arguments

  • event - Pointer to an ArkUI_UIInputEvent object.

  • pressedKeyCodes - Array of all keys that are pressed. You need to allocate the memory space.

  • length - Length of the passed pressedKeyCodes array (when used as an input parameter); number of the keys pressed (when used as an output parameter).

§Returns

  • Returns the result code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_BUFFER_SIZE_NOT_ENOUGH] if the giving buffer is not enough. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs.

Available since API-level: 14