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

◆ keys_state_key_update()

int keys_state_key_update ( struct keys_state * ks,
uint16_t key_id,
bool pressed,
bool * ks_changed )

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

Notify keys state about a key press/release.

The utility can record multiple key presses for a given key ID. The same number of key releases is needed for the utility to report release of the key.

Parameters
[in]ksA keys state object.
[in]key_idKey ID.
[in]pressedInformation if key was pressed or released.
[out]ks_changedInformation if state of the pressed keys changed.
Return values
0when successful.
-ENOENTif key is released, but related key press was not recorded by the utility.
-ENOBUFSif key is pressed and number of active keys exceeds the limit.