Add layout-aware AltGr/Shift/base-character labels - #30
Open
kolbenhans wants to merge 1 commit into
Open
Conversation
KeyPeek showed "7 + Alt" for RALT(KC_7) regardless of OS keyboard
layout, when e.g. German AltGr+7 actually produces "{". Adds a
Settings dropdown (US/German/French/Italian/Spanish) that resolves
AltGr, explicit Shift(key) combos, and the key's own base character to
what they actually produce on that layout — including letter swaps
(German Y/Z, French A/Q and W/Z), AZERTY's inverted number row, and
ISO-only keys (KC_NONUS_HASH/KC_NONUS_BACKSLASH). Resolution happens
at draw time (src/overlay_window/ui_overlay.rs), so switching the
layout while connected updates immediately without reconnecting.
All four non-US tables are sourced from `xkbcli compile-keymap
--layout <code>` rather than hand-tracing xkb include chains (the
latter caused a real bug during development: an earlier manual read
picked up the wrong "type4"/default xkb variant for the German
6/7/8/9/0 shift row).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
KeyPeek currently renders
RALT(KC_7)as "7" with a generic "Alt" badge, regardless of the user's OS keyboard layout. On a German keyboard, AltGr+7 actually produces{. This adds a Settings dropdown to resolve AltGr, explicitShift(key)combos, and a key's own base character to what they actually produce on non-US layouts.ui_overlay.rs), so switching the dropdown while connected updates immediately, no reconnect neededKC_NONUS_HASH/KC_NONUS_BACKSLASH)xkbcli compile-keymap --layout <code>(not hand-traced xkb include chains, which caused a real bug during development — see commit message)Screenshots
menu dopdown

before1


after1
Test plan
cargo build/cargo fmt/cargo testall pass🤖 Generated with Claude Code