nRF Connect SDK API 3.3.99
Loading...
Searching...
No Matches

◆ keys_state_keys_get()

size_t keys_state_keys_get ( const struct keys_state * ks,
uint16_t * res,
size_t res_size )

#include <applications/nrf_desktop/src/util/keys_state.h>

Get keys state.

The function fills the provided array with key IDs of all active keys. The utility keeps key IDs sorted in ascending order to ensure consistent results.

The function asserts if size of the provided array is too small to handle the maximum number of active keys.

Parameters
[in]ksA keys state object.
[out]resArray to be filled with key IDs of active keys.
[in]res_sizeSize of the provided array.
Returns
Number of keys written.