Skip to content

Add Q5 Pro ANSI encoder host lighting keymap - #528

Open
joseamirandavelez wants to merge 5 commits into
Keychron:wireless_playgroundfrom
joseamirandavelez:q5-pro-ansi-host-lighting
Open

joseamirandavelez wants to merge 5 commits into
Keychron:wireless_playgroundfrom
joseamirandavelez:q5-pro-ansi-host-lighting

Conversation

@joseamirandavelez

@joseamirandavelez joseamirandavelez commented Oct 25, 2026 •

Copy link
Copy Markdown

Summary

  • Adds an rgbj keymap for the Q5 Pro ANSI encoder. A host can stream LED colors over raw HID (commands 0x21 through 0x28) while VIA stays available for everything else.
  • Num Lock and Caps Lock stay solid white while those locks are on, including during a color stream, so the keys do not flicker between white and the effect color.
  • While a host is streaming, lighting keys and the Launcher cannot switch to an onboard effect or turn the matrix off. A bad color frame stays silent, so the next handshake is not answered by a leftover report.
  • Onboard effects advance by elapsed time times the current speed. Dragging speed, color, or brightness in the Launcher changes the live effect without restarting the pattern. Switching to a different effect still starts that effect.
  • Stock keymaps are unchanged. The new raw HID hook is weak and returns false, so VIA still owns every other command. Color frames are claimed and not echoed.
  • The Q5 Pro board links again: Keychron debounce is the only debounce object, the language header is on the include path, and the keyboard EEPROM header is included up front the same way as on the V3 Max.
  • The rgbj keymap uses asymmetric eager-defer debounce at 10ms. One tap was sometimes coming out as two or three of the same character. The switch contact bounces, and the old eager per-key debounce only ignored those extra edges for 5ms, so bounce that lasted longer became another press. The press is still reported immediately, so a key you keep holding stays held. The release waits until the contact has stayed open for the whole window, so a bounce cannot become a second character. The saved setting is moved over on first boot. A later change in the Launcher is left alone.

Test plan

  • make keychron/q5_pro/ansi_encoder:rgbj
  • make keychron/q5_pro/ansi_encoder:via still links
  • Flash the ANSI encoder build, stream colors from a host, and toggle Num Lock and Caps Lock. Those keys should go solid white with no flicker.
  • While streaming, RGB keys and a Launcher effect change should leave the host colors running. Turning host mode off should restore the saved onboard effect.
  • With host mode off, drag speed in the Launcher. The pattern should change rate without jumping back to the start.
  • VIA still opens the keyboard and reads the keymap
  • If the layout looks wrong after flashing, reload it in VIA. Including the keyboard EEPROM header changes the user EEPROM block on this board.
  • Flash this build and type, including a held key. A tap should be one character, and holding should still repeat.

Made with Cursor

Num Lock and Caps Lock stay solid white while a host streams colors. VIA no longer echoes those frames. The board links with Keychron debounce only, and the keyboard EEPROM header is included the same way as on the V3 Max.

Co-authored-by: Cursor <cursoragent@cursor.com>
A streaming host stays on its effect, and a bad color frame no longer replies. Onboard effects advance by elapsed time times speed, so Launcher sliders change the rate without restarting the pattern.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions github-actions Bot added the core label Oct 25, 2026
joseamirandavelez and others added 3 commits October 26, 2026 12:04
Eager per-key accepted a new edge every 5ms, so contact bounce showed up as two or three of the same character. The press is still immediate, so holding a key still holds it. The release waits until the contact has been open for 10ms.

Co-authored-by: Cursor <cursoragent@cursor.com>
Symmetric eager debounce locks out late bounce after release, host mode blacks the last onboard frame on enter, and Bluetooth NKRO stays off so wireless reports stay clean.

Co-authored-by: Cursor <cursoragent@cursor.com>
If no colour frames arrive for a few seconds, leave host mode and reload the EEPROM effect so a quit or crashed app does not freeze the last frame.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant