Skip to content

Commit 02c5b98

Browse files
MarekPietakapi-no
authored andcommitted
applications: nrf_desktop: Update HID state module doc
Change updates HID state module documentation to inform about keys state utility integration. Jira: NCSDK-33999 Signed-off-by: Marek Pieta <[email protected]> Signed-off-by: Divya Pillai <[email protected]>
1 parent 1a4d4d7 commit 02c5b98

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

applications/nrf_desktop/doc/hid_state.rst

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,12 @@ Report expiration
107107
With the :ref:`CONFIG_DESKTOP_HID_REPORT_EXPIRATION <config_desktop_app_options>` Kconfig option, you can set the amount of time after which a queued key will be considered expired.
108108
The higher the value, the longer the period from which the nRF Desktop application will recall pressed keys when the connection with HID host is established.
109109

110+
Handling keys state
111+
===================
112+
113+
The module selects the :ref:`CONFIG_DESKTOP_KEYS_STATE <config_desktop_app_options>` Kconfig option to enable the :ref:`nrf_desktop_keys_state`.
114+
The utility is used to track the state of active keys after the connection with the HID host is established.
115+
110116
Implementation details
111117
**********************
112118

@@ -163,7 +169,7 @@ This is done by obtaining the key mapping from the :ref:`nrf_desktop_hid_keymap`
163169

164170
Once the mapping is obtained, the application checks if the report to which the usage belongs is connected:
165171

166-
* If the report is connected, the value is stored at the right position in the ``items`` member of :c:struct:`report_data` associated with the report.
172+
* If the report is connected, the :ref:`nrf_desktop_keys_state` instance is used to track the state of active keys associated with a given HID report.
167173
* If the report is not connected, the value is stored in the :ref:`nrf_desktop_hid_eventq` instance in the same structure.
168174

169175
The difference between these operations is that storing value onto the queue (second case) preserves the order of input events.

doc/nrf/releases_and_maturity/releases/release-notes-changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ nRF Desktop
285285

286286
* Use the :ref:`nrf_desktop_hid_eventq` to temporarily queue HID events related to keypresses before a connection to the HID host is established.
287287
* Use the :ref:`nrf_desktop_hid_keymap` to map an application-specific key ID from :c:struct:`button_event` to a HID report ID and HID usage ID pair.
288+
* Use the :ref:`nrf_desktop_keys_state` to track the state of active keys.
288289

289290
The features were implemented directly in the HID state module before.
290291
This change simplifies the HID state module implementation and allows code reuse.

0 commit comments

Comments
 (0)