Skip to content

Commit

Permalink
feat: add German CMOS layout
Browse files Browse the repository at this point in the history
  • Loading branch information
aradzie committed Oct 25, 2024
1 parent cf2865f commit 483097d
Show file tree
Hide file tree
Showing 6 changed files with 127 additions and 3 deletions.
51 changes: 51 additions & 0 deletions packages/keybr-generators/layouts/de_cmos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"Backquote": "",
"Digit1": "",
"Digit2": "",
"Digit3": "3ℓ",
"Digit4": "",
"Digit5": "",
"Digit6": "6$",
"Digit7": "7€",
"Digit8": "8„",
"Digit9": "9“",
"Digit0": "0”",
"Minus": "-—",
"Equal": "",
"KeyQ": "jJ",
"KeyW": "kK",
"KeyE": "uU",
"KeyR": "oO",
"KeyT": "äÄ",
"KeyY": "pP",
"KeyU": "bB",
"KeyI": "lL",
"KeyO": "mM",
"KeyP": "ß",
"BracketLeft": "xX",
"BracketRight": "qQ",
"Backslash": "",
"KeyA": "wW",
"KeyS": "hH",
"KeyD": "iI",
"KeyF": "eE",
"KeyG": "aA",
"KeyH": "dD",
"KeyJ": "tT",
"KeyK": "nN",
"KeyL": "rR",
"Semicolon": "sS",
"Quote": "´˜",
"IntlBackslash": "",
"KeyZ": "yY",
"KeyX": ".:",
"KeyC": "üÜ",
"KeyV": ",;",
"KeyB": "öÖ",
"KeyN": "gG",
"KeyM": "cC",
"Comma": "vV",
"Period": "zZ",
"Slash": "fF",
"Space": " "
}
1 change: 1 addition & 0 deletions packages/keybr-generators/lib/generate-layouts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ for (const [id, dict] of [
["cs_cz", importCldr("cldr-keyboards-43.0/keyboards/windows/cs-t-k0-windows.xml")],
["de_bone", importKeymap("layouts/de_bone.json")],
["de_ch", importCldr("cldr-keyboards-43.0/keyboards/windows/de-CH-t-k0-windows.xml")],
["de_cmos", importKeymap("layouts/de_cmos.json")],
["de_de", importCldr("cldr-keyboards-43.0/keyboards/windows/de-t-k0-windows.xml")],
["de_mine", importKeymap("layouts/de_mine.json")],
["de_neo_2", importKeymap("layouts/de_neo_2.json")],
Expand Down
6 changes: 3 additions & 3 deletions packages/keybr-generators/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
"clean": "rm -fr .types",
"compile": "tsc",
"test": "ava",
"generate-books": "node -r @keybr/tsl ./lib/generate-books.ts",
"generate-languages": "node -r @keybr/tsl ./lib/generate-languages.ts",
"generate-layouts": "node -r @keybr/tsl ./lib/generate-layouts.ts"
"generate-books": "node --import @keybr/tsl ./lib/generate-books.ts",
"generate-languages": "node --import @keybr/tsl ./lib/generate-languages.ts",
"generate-layouts": "node --import @keybr/tsl ./lib/generate-layouts.ts"
},
"ava": {
"files": [
Expand Down
16 changes: 16 additions & 0 deletions packages/keybr-keyboard/lib/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,21 @@ export class Layout implements XEnumItem {
Geometry.MATRIX,
),
);
static readonly DE_CMOS = new Layout(
/* id= */ "de-cmos",
/* xid= */ 0x26,
/* name= */ "CMOS",
/* family= */ "de-cmos",
/* language= */ Language.DE,
/* emulate= */ false,
/* geometries= */ new Enum(
Geometry.ISO_102,
Geometry.ISO_102_FULL,
Geometry.ANSI_101,
Geometry.ANSI_101_FULL,
Geometry.MATRIX,
),
);
static readonly FR_FR = new Layout(
/* id= */ "fr-fr",
/* xid= */ 0x30,
Expand Down Expand Up @@ -1012,6 +1027,7 @@ export class Layout implements XEnumItem {
Layout.DE_BONE,
Layout.DE_MINE,
Layout.DE_NOTED,
Layout.DE_CMOS,
Layout.FR_FR,
Layout.FR_CA,
Layout.FR_CH,
Expand Down
54 changes: 54 additions & 0 deletions packages/keybr-keyboard/lib/layout/de_cmos.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Generated file, do not edit.

import { type CharacterDict } from "../types.ts";

// prettier-ignore
export const LAYOUT_DE_CMOS: CharacterDict = {
Backquote: [/* ^ */ 0x005e, /* ˇ */ 0x02c7],
Digit1: [/* 1 */ 0x0031, /* ° */ 0x00b0],
Digit2: [/* 2 */ 0x0032, /* § */ 0x00a7],
Digit3: [/* 3 */ 0x0033, /* ℓ */ 0x2113],
Digit4: [/* 4 */ 0x0034, /* » */ 0x00bb],
Digit5: [/* 5 */ 0x0035, /* « */ 0x00ab],
Digit6: [/* 6 */ 0x0036, /* $ */ 0x0024],
Digit7: [/* 7 */ 0x0037, /* € */ 0x20ac],
Digit8: [/* 8 */ 0x0038, /* „ */ 0x201e],
Digit9: [/* 9 */ 0x0039, /* “ */ 0x201c],
Digit0: [/* 0 */ 0x0030, /* ” */ 0x201d],
Minus: [/* - */ 0x002d, /* — */ 0x2014],
Equal: [/* ` */ 0x0060, /* ¸ */ 0x00b8],
KeyQ: [/* j */ 0x006a, /* J */ 0x004a],
KeyW: [/* k */ 0x006b, /* K */ 0x004b],
KeyE: [/* u */ 0x0075, /* U */ 0x0055],
KeyR: [/* o */ 0x006f, /* O */ 0x004f],
KeyT: [/* ä */ 0x00e4, /* Ä */ 0x00c4],
KeyY: [/* p */ 0x0070, /* P */ 0x0050],
KeyU: [/* b */ 0x0062, /* B */ 0x0042],
KeyI: [/* l */ 0x006c, /* L */ 0x004c],
KeyO: [/* m */ 0x006d, /* M */ 0x004d],
KeyP: [/* ß */ 0x00df],
BracketLeft: [/* x */ 0x0078, /* X */ 0x0058],
BracketRight: [/* q */ 0x0071, /* Q */ 0x0051],
KeyA: [/* w */ 0x0077, /* W */ 0x0057],
KeyS: [/* h */ 0x0068, /* H */ 0x0048],
KeyD: [/* i */ 0x0069, /* I */ 0x0049],
KeyF: [/* e */ 0x0065, /* E */ 0x0045],
KeyG: [/* a */ 0x0061, /* A */ 0x0041],
KeyH: [/* d */ 0x0064, /* D */ 0x0044],
KeyJ: [/* t */ 0x0074, /* T */ 0x0054],
KeyK: [/* n */ 0x006e, /* N */ 0x004e],
KeyL: [/* r */ 0x0072, /* R */ 0x0052],
Semicolon: [/* s */ 0x0073, /* S */ 0x0053],
Quote: [/* ´ */ 0x00b4, /* ˜ */ 0x02dc],
KeyZ: [/* y */ 0x0079, /* Y */ 0x0059],
KeyX: [/* . */ 0x002e, /* : */ 0x003a],
KeyC: [/* ü */ 0x00fc, /* Ü */ 0x00dc],
KeyV: [/* , */ 0x002c, /* ; */ 0x003b],
KeyB: [/* ö */ 0x00f6, /* Ö */ 0x00d6],
KeyN: [/* g */ 0x0067, /* G */ 0x0047],
KeyM: [/* c */ 0x0063, /* C */ 0x0043],
Comma: [/* v */ 0x0076, /* V */ 0x0056],
Period: [/* z */ 0x007a, /* Z */ 0x005a],
Slash: [/* f */ 0x0066, /* F */ 0x0046],
Space: [/* SPACE */ 0x0020],
};
2 changes: 2 additions & 0 deletions packages/keybr-keyboard/lib/load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { LAYOUT_BE_BY } from "./layout/be_by.ts";
import { LAYOUT_CS_CZ } from "./layout/cs_cz.ts";
import { LAYOUT_DE_BONE } from "./layout/de_bone.ts";
import { LAYOUT_DE_CH } from "./layout/de_ch.ts";
import { LAYOUT_DE_CMOS } from "./layout/de_cmos.ts";
import { LAYOUT_DE_DE } from "./layout/de_de.ts";
import { LAYOUT_DE_MINE } from "./layout/de_mine.ts";
import { LAYOUT_DE_NEO_2 } from "./layout/de_neo_2.ts";
Expand Down Expand Up @@ -89,6 +90,7 @@ const layoutDict = new Map<Layout, CharacterDict>([
[Layout.CS_CZ, LAYOUT_CS_CZ],
[Layout.DE_BONE, LAYOUT_DE_BONE],
[Layout.DE_CH, LAYOUT_DE_CH],
[Layout.DE_CMOS, LAYOUT_DE_CMOS],
[Layout.DE_DE, LAYOUT_DE_DE],
[Layout.DE_MINE, LAYOUT_DE_MINE],
[Layout.DE_NEO_2, LAYOUT_DE_NEO_2],
Expand Down

0 comments on commit 483097d

Please sign in to comment.