Buttons module

The buttons module is responsible for generating events related to key presses. The source of events are changes to GPIO pins.

Module events

Source Module

Input Event

This Module

Output Event

Sink Module

Power manager module



Source modules for module_state_event


Bluetooth LE advertising module


Buttons module

HID forward module

Motion module

Power manager module

Wheel module


Function key module

Motion module

Button simulator module

Click detector module

Passkey module

HID state module


Sink modules for module_state_event


Sink modules for wake_up_event


See the Overview: Firmware architecture for more information about the event-based communication in the nRF Desktop application and about how to read this table.

Implementation details

nRF Desktop uses the buttons module from Common Application Framework (CAF). See the CAF button module page for implementation details.

Key ID

If CONFIG_DESKTOP_FN_KEYS_ENABLE is enabled, the button_event.key_id additionally encodes if a button related to button_event is a function key. See the nRF Desktop function key module page for implementation details.