Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/keybr-keyboard/lib/geometry.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Enum, type EnumItem } from "@keybr/lang";
import {
STANDARD_MOD,
GERMAN_MOD,
SYMMETRIC_MOD,
type ZoneModDict,
} from "./geometry/mod.ts";
Expand All @@ -11,6 +12,11 @@ export class ZoneMod implements EnumItem {
"Standard",
STANDARD_MOD,
);
static readonly GERMAN = new ZoneMod(
"german",
"german",
GERMAN_MOD,
);
static readonly SYMMETRIC = new ZoneMod(
"symmetric",
"Symmetric",
Expand All @@ -19,6 +25,7 @@ export class ZoneMod implements EnumItem {

static readonly ALL = new Enum<ZoneMod>(
ZoneMod.STANDARD, //
ZoneMod.GERMAN,
ZoneMod.SYMMETRIC,
);

Expand Down
6 changes: 3 additions & 3 deletions packages/keybr-keyboard/lib/geometry/iso_102.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@ export const ISO_102: GeometryDict = {
Digit2: {
x: 2,
y: 0,
zones: ["ring", "left", "digit"],
zones: ["pinky", "left", "digit"],
},
Digit3: {
x: 3,
y: 0,
zones: ["middle", "left", "digit"],
zones: ["ring", "left", "digit"],
},
Digit4: {
x: 4,
y: 0,
zones: ["leftIndex", "left", "digit"],
zones: ["middle", "left", "digit"],
},
Digit5: {
x: 5,
Expand Down
66 changes: 66 additions & 0 deletions packages/keybr-keyboard/lib/geometry/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,72 @@ export type ZoneModDict = Record<KeyId, readonly ZoneId[]>;

export const STANDARD_MOD: ZoneModDict = {};

export const GERMAN_MOD: ZoneModDict = {
// pinky, ring, middle, leftIndex, rightIndex, middle, ring, pinky
Backquote: ["pinky", "left", "digit"],
Digit1: ["pinky", "left", "digit"],
Digit2: ["pinky", "left", "digit"],
Digit3: ["ring", "left", "digit"],
Digit4: ["middle", "left", "digit"],
Digit5: ["leftIndex", "left", "digit"],
Digit6: ["leftIndex", "left", "digit"],
Digit7: ["rightIndex", "right", "digit"],
Digit8: ["rightIndex", "right", "digit"],
Digit9: ["middle", "right", "digit"],
Digit0: ["ring", "right", "digit"],
Minus: ["pinky", "right", "digit"],
Equal: ["pinky", "right", "digit"],
Backspace: ["pinky", "right", "digit"],

Tab: ["pinky", "left", "top"],
KeyQ: ["pinky", "left", "top"],
KeyW: ["ring", "left", "top"],
KeyE: ["middle", "left", "top"],
KeyR: ["leftIndex", "left", "top"],
KeyT: ["leftIndex", "left", "top"],
KeyY: ["rightIndex", "right", "top"],
KeyU: ["rightIndex", "right", "top"],
KeyI: ["middle", "right", "top"],
KeyO: ["ring", "right", "top"],
KeyP: ["pinky", "right", "top"],
BracketLeft: ["pinky", "right", "top"],
BracketRight: ["pinky", "right", "top"],
Backslash: ["pinky", "right", "top"],

CapsLock: ["pinky", "left", "home"],
KeyA: ["pinky", "left", "home"],
KeyS: ["ring", "left", "home"],
KeyD: ["middle", "left", "home"],
KeyF: ["leftIndex", "left", "home"],
KeyG: ["leftIndex", "left", "home"],
KeyH: ["rightIndex", "right", "home"],
KeyJ: ["rightIndex", "right", "home"],
KeyK: ["middle", "right", "home"],
KeyL: ["ring", "right", "home"],
Semicolon: ["pinky", "right", "home"],
Quote: ["pinky", "right", "home"],
Enter: ["pinky", "right", "home"],

ShiftLeft: ["pinky", "left", "bottom"],
KeyZ: ["pinky", "left", "bottom"],
KeyX: ["ring", "left", "bottom"],
KeyC: ["middle", "left", "bottom"],
KeyV: ["leftIndex", "left", "bottom"],
KeyB: ["leftIndex", "left", "bottom"],
KeyN: ["rightIndex", "right", "bottom"],
KeyM: ["rightIndex", "right", "bottom"],
Comma: ["middle", "right", "bottom"],
Period: ["ring", "right", "bottom"],
Slash: ["pinky", "right", "bottom"],
ShiftRight: ["pinky", "right", "bottom"],

ControlLeft: ["pinky", "left", "bottom"],
AltLeft: ["ring", "left", "bottom"],
Space: ["thumb", "right", "bottom"],
AltRight: ["pinky", "right", "bottom"],
ControlRight: ["pinky", "right", "bottom"],
};

export const ANGLE_MOD: ZoneModDict = {
Backquote: ["pinky", "left", "digit"],
Digit1: ["pinky", "left", "digit"],
Expand Down