@keyboard-hub/keycode-preview-zmk
v0.0.1
Published
ZMK keycode preview extension for `@keyboard-hub/keycode-preview`.
Downloads
316
Readme
@keyboard-hub/keycode-preview-zmk
ZMK keycode preview extension for @keyboard-hub/keycode-preview.
import { KeycodeCatalog } from "@keyboard-hub/keycode-preview";
import { zmkKeycodePreviewExtension } from "@keyboard-hub/keycode-preview-zmk";
const catalog = new KeycodeCatalog({
defaultDisplayFormat: "zmk",
extensions: [zmkKeycodePreviewExtension],
});
catalog.format("ESC")?.label;
// "&kp ESCAPE"
catalog.format("MO(1)")?.label;
// "&mo\n1"
catalog.format("DF(0)")?.label;
// "&df\n0"The generated mapping table lists only KeyboardHub keycodes that resolve to a ZMK symbol.
Parameterized custom code labels use newline-separated behavior and parameter
lines for compact keycap previews. The ariaLabel and search terms keep the
one-line ZMK expression.
The extension also contributes ZMK-only custom usage-page definitions such as
DF and EXT_POWER, all handled by the normal zmk display format.
