BLE HID Central (HOGP - HID over GATT Profile) module for ZMK firmware.
This module allows ZMK keyboards to connect to external BLE HID devices (mice, trackpads) and forward their input through the keyboard.
- HOGP Central: Connect to BLE HID devices as a central
- Auto-reconnect: Automatically reconnect to bonded devices on boot
- Pairing mode: Manual pairing with configurable timeout
- Serial commands: Debug and control via USB serial console
manifest:
remotes:
- name: hh
url-base: https://github.com/hh
projects:
- name: zmk-hogp
remote: hh
revision: mainMany BLE trackpads use LE Legacy pairing, but upstream ZMK forces Secure Connections Only. Apply the included patch:
./zmk-hogp/scripts/apply-patches.shOr manually patch zmk/app/Kconfig:
menuconfig ZMK_BLE
select BT
select BT_SMP
- select BT_SMP_SC_PAIR_ONLY
+ select BT_SMP_SC_PAIR_ONLY if !ZMK_HOGPAdd to your board's _defconfig or prj.conf:
# Enable HOGP central
CONFIG_ZMK_HOGP=y
CONFIG_ZMK_HOGP_LOG_LEVEL_DBG=y
# Enable serial commands (auto-enabled with HOGP)
CONFIG_ZMK_SERIAL_CMD=y
CONFIG_ZMK_USB_LOGGING=y
# Required: BLE Central role
CONFIG_BT_CENTRAL=y
CONFIG_BT_GATT_CLIENT=y
# Required: Allow Legacy Pairing for trackpads
CONFIG_BT_SMP_SC_PAIR_ONLY=n
CONFIG_BT_SMP_ENFORCE_MITM=n
# Recommended: Bonding settings
CONFIG_BT_KEYS_OVERWRITE_OLDEST=y
CONFIG_BT_MAX_PAIRED=7
Commands must be prefixed with !:
| Command | Description |
|---|---|
!pair |
Enter HOGP pairing mode (30 sec scan) |
!unpair |
Exit pairing mode |
!hogp |
Show HOGP connection status |
!clear |
Clear HOGP device bonds |
!forget |
Clear all BLE bonds |
!boot |
Enter UF2 bootloader |
!reboot |
Soft reset keyboard |
!ble |
Switch to BLE output |
!usb |
Switch to USB output |
!help |
Show available commands |
- Build and flash firmware with USB logging enabled
- Open serial console:
picocom /dev/ttyACM0 -b 115200 - Put your trackpad in pairing mode
- Send
!pairto start scanning - Device will connect when HID Service UUID (0x1812) is found
- Switch keyboard to BLE output (
!ble) to forward trackpad data to host
| Device | MAC Pattern | Notes |
|---|---|---|
| ProtoArc T1 Plus | EC:FD:72:xx:xx:xx |
Advertises without name, uses Legacy pairing |
This means the trackpad uses Legacy pairing but ZMK is forcing Secure Connections Only.
Fix: Apply the ZMK patch (see Installation step 3) and ensure these configs are set:
CONFIG_BT_SMP_SC_PAIR_ONLY=n
CONFIG_BT_SMP_ENFORCE_MITM=n
Ensure USB logging is enabled:
CONFIG_ZMK_USB_LOGGING=y
The trackpad data flows through BLE, not USB. Switch the keyboard to BLE output:
!ble
For custom report handling:
#include <zmk/hogp/hogp.h>
void my_report_handler(const uint8_t *data, uint16_t len) {
// Process HID report (e.g., forward to host)
}
hogp_register_report_callback(my_report_handler);┌─────────────────┐ BLE HOGP ┌──────────────┐
│ BLE Trackpad │ ───────────────> │ Keyboard │
│ (HID Peripheral)│ │ (HID Central)│
└─────────────────┘ └──────┬───────┘
│
│ BLE/USB HID
v
┌──────────────┐
│ Host │
│ Computer │
└──────────────┘
MIT License - See LICENSE