![]() |
nRF Connect SDK API 3.3.99
|
| 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.
| [in] | ks | A keys state object. |
| [in] | key_id | Key ID. |
| [in] | pressed | Information if key was pressed or released. |
| [out] | ks_changed | Information if state of the pressed keys changed. |
| 0 | when successful. |
| -ENOENT | if key is released, but related key press was not recorded by the utility. |
| -ENOBUFS | if key is pressed and number of active keys exceeds the limit. |