Skip to content

Add wireless battery reporting to Keychron raw HID - #504

Open
shayangohar wants to merge 1 commit into
Keychron:2025q3from
shayangohar:keychron-wireless-raw-hid-core
Open

Add wireless battery reporting to Keychron raw HID#504
shayangohar wants to merge 1 commit into
Keychron:2025q3from
shayangohar:keychron-wireless-raw-hid-core

Conversation

@shayangohar

Copy link
Copy Markdown

Description

This adds an opt-in wireless raw HID path to Keychron's common firmware and exposes the cached battery percentage to host utilities.

The change:

  • Adds KC_GET_BATTERY_LEVEL (0xA4).
  • Returns the battery percentage in response byte 1.
  • Routes wireless EVT_RAW_HID events through the normal raw_hid_receive() handler.
  • Corrects the misspelled WILRESS_RAW_ENABLE define to WIRELESS_RAW_ENABLE.
  • Updates documentation accordingly to record the command and opt-in build define
  • Keeps wireless transport routing disabled unless a keyboard explicitly defines WIRELESS_RAW_ENABLE.

This allows a Keychron 2.4 GHz receiver to report keyboard battery status without using Bluetooth. It does not modify receiver firmware, battery calculation, key behavior, or Bluetooth behavior.

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Verification

  • git diff --check passes.
  • The change is based on Keychron's 2025q3 branch.
  • The combined common-core and K8 HE opt-in firmware was built successfully.
  • The resulting firmware was tested on a Keychron K8 HE using the Keychron 2.4 GHz receiver.
  • A tray utility successfully retrieved a valid battery percentage over 2.4 GHz.
  • Keyboard worked fine with no issues over wired connection, 2.4 GHz, and Bluetooth.

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

@github-actions github-actions Bot added documentation Improvements or additions to documentation keyboard labels Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation keyboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant