Repository navigation
feat(kbd): layouts desde XKB (sin .klc) + tests + migración - #705
Merged
Merged
Conversation
kbdcompile never parsed the real KLC layout table, so US.kbd/Spanish.kbd shipped with 256 empty entries. Only the kernel's built-in US fallback worked; switching to Spanish changed the index but typed nothing. - rewrite the KLC parser: shift-state columns, `@` dead keys and the DEADKEY/COMPOSE tables; regenerate the layouts from the sources. - rename the layouts to locale tags `en-US`/`es-ES` (files `en-US.kbd`/`es-ES.kbd`) and migrate legacy `US`/`Spanish` Registry values on load. - add kernel tests for switching by name (case-insensitive) and typing with the Spanish layout (ñ/Ñ/ç, dead keys, composition).
The Registry value was only normalised in memory at load, so a legacy `Layout = "Spanish"`/`"US"` stayed on disk until the next write. Resolve the persisted name against the layouts actually loaded (by name, language tag, then legacy `US`/`Spanish` aliases) in `kbd_init()`, and persist the canonical name when it differs — the Registry now converges to `en-US`/`es-ES` instead of keeping a stale value. Drops the static `normalize_layout_name` table from `kbd_load_config`.
Extend the NeoKBD tests toward the §7 plan: a missing `.kbd` is rejected, repeat delay/rate bounds are enforced, the LED mask is clamped to 0x07 and Shift make/break toggles the modifier bit.
Sourcing layouts from Microsoft `.klc` is awkward (MSKLC GUI) and the files are Microsoft-licensed. Add a host tool that reads the open, offline XKB data (`/usr/share/X11/xkb/symbols/*`) and emits the NeoDOS `.kbd` format directly. - resolves `include "file(section)"` chains, maps EVDEV -> set-1 scancodes, maps levels 1-3 to normal/shift/altgr, translates Latin-1 / `U<hex>` / common keysym names, marks dead keys and builds the compose table from the X11 `Compose` file. - verified `us`, `es`, `fr`, `de`: the `es` output matches the `.klc`-derived `es-ES` (ñ/Ñ, ´/¨, ç/Ç, dead keys, ¡/¿). Related: #390 (dynamic .kbd discovery) — new layouts still need wiring into the image allowlist and the kernel load list.
Make the open, offline XKB data the source of truth for keyboard layouts and remove the intermediate `.klc` files. - xkbcompile: strip `//` comments before splitting statements (an `include` preceded by a comment was being dropped — broke no/pl/br), add Latin-2 keysyms, and use it to generate 15 locales (en-US … cs-CZ; es-ES via `es(deadtilde)` so dead tilde is AltGr+4). - data/keyboard: remove en-US.klc/es-ES.klc; add the generated .kbd. - scripts/gen + check for all locales, wired into a CI job. - kernel: load_kbd sizes the buffer from the inode instead of a fixed 8 KiB cap; only en-US/es-ES are enabled at boot for now — loading all fifteen stresses the page cache and triggers #709.
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.
Consolida el pipeline de layouts de teclado.
Qué
tools/xkbcompile): resuelveinclude, EVDEV→scancode set-1, niveles 1-3, keysyms Latin-1/U<hex>/Latin-2, dead keys + compose desde elComposede X11..klc(en-US.klc,es-ES.klc); los.kbdse generan de XKB.es(deadtilde), dead tilde en AltGr+4), ca-ES (es(cat)), fr-FR, de-DE, it-IT, pt-PT, pt-BR, nl-NL, sv-SE, da-DK, nb-NO, fi-FI, pl-PL, cs-CZ.scripts/gen-keyboard-layouts.sh/check-keyboard-layouts.sh+ job de CI.load_kbddimensiona el buffer por inodo (antes cap fijo 8 KiB); migración/persistencia deLayouten Registry; tests extra (KBD-TESTS: Tests de integración de NeoKBD #394).Limitación conocida
Solo en-US/es-ES se cargan al boot por ahora: habilitar los 15 llena la page cache y destapa #709 (eviction de páginas dirty por
dev_tag/LBA). Para activar el resto, una vez arreglado #709, basta ampliarLAYOUT_TAGS(kernel) ykbd_layouts(NeoDev, PR #42).Verificación
neodev build --image+neodev test→ 968/968.check-keyboard-layouts.shOK.check-i18n,check-skills,markdownlintOK.