![]() |
Edge AI Add-on API 2.2.0
|
| int ble_hid_send_key | ( | ble_hid_key_t | key | ) |
#include <applications/gesture_recognition/src/ble/hid/ble_hid.h>
Send a keyboard or consumer-control key via the HID profile.
Sends a key press followed by a key release for the specified key. Standard keys (arrows, F5, ESC) are sent as keyboard reports; media keys (play/pause, volume, track, mute) are sent as consumer-control reports.
| key | Key to send, see ble_hid_key_t |
| 0 | Key sent successfully. |
| -EBUSY | Device is currently in pairing mode; key not sent. |
| -ENOTCONN | No active BLE connection. |
| -EAGAIN | BLE link is up but the peer has not yet enabled HID notifications (CCCD not written); key not sent. |
| -EINVAL | Unknown or unsupported key code. |
| <0 | Other negative errno from the underlying HID service. |