Skip to content

Commit b1c12d2

Browse files
authored
add symmetrical finger zone layout for iso_102 US (#285) (#308)
1 parent 16cb590 commit b1c12d2

File tree

4 files changed

+344
-0
lines changed

4 files changed

+344
-0
lines changed

packages/keybr-keyboard/lib/geometry.ts

+6
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ export class Geometry implements EnumItem {
2121
"ISO 102 (Full)",
2222
"staggered",
2323
);
24+
static readonly ISO_102_SYMMETRIC = new Geometry(
25+
"iso102symmetric", //
26+
"ISO 102 (Symmetric)",
27+
"staggered",
28+
);
2429
static readonly KOREAN_103 = new Geometry(
2530
"kr103", //
2631
"Korean 103",
@@ -62,6 +67,7 @@ export class Geometry implements EnumItem {
6267
Geometry.ANSI_101_FULL,
6368
Geometry.ISO_102,
6469
Geometry.ISO_102_FULL,
70+
Geometry.ISO_102_SYMMETRIC,
6571
Geometry.KOREAN_103,
6672
Geometry.KOREAN_103_FULL,
6773
Geometry.BRAZILIAN_104,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,335 @@
1+
import { type GeometryDict } from "../types.ts";
2+
3+
// See https://www.w3.org/TR/uievents-code/#keyboard-102
4+
export const ISO_102_SYMMETRIC: GeometryDict = {
5+
Backquote: {
6+
x: 0,
7+
y: 0,
8+
zones: ["pinky", "left", "digit"],
9+
},
10+
Digit1: {
11+
x: 1,
12+
y: 0,
13+
zones: ["pinky", "left", "digit"],
14+
},
15+
Digit2: {
16+
x: 2,
17+
y: 0,
18+
zones: ["ring", "left", "digit"],
19+
},
20+
Digit3: {
21+
x: 3,
22+
y: 0,
23+
zones: ["middle", "left", "digit"],
24+
},
25+
Digit4: {
26+
x: 4,
27+
y: 0,
28+
zones: ["middle", "left", "digit"],
29+
},
30+
Digit5: {
31+
x: 5,
32+
y: 0,
33+
zones: ["leftIndex", "left", "digit"],
34+
},
35+
Digit6: {
36+
x: 6,
37+
y: 0,
38+
zones: ["leftIndex", "right", "digit"],
39+
},
40+
Digit7: {
41+
x: 7,
42+
y: 0,
43+
zones: ["rightIndex", "right", "digit"],
44+
},
45+
Digit8: {
46+
x: 8,
47+
y: 0,
48+
zones: ["middle", "right", "digit"],
49+
},
50+
Digit9: {
51+
x: 9,
52+
y: 0,
53+
zones: ["middle", "right", "digit"],
54+
},
55+
Digit0: {
56+
x: 10,
57+
y: 0,
58+
zones: ["ring", "right", "digit"],
59+
},
60+
Minus: {
61+
x: 11,
62+
y: 0,
63+
zones: ["pinky", "right", "digit"],
64+
},
65+
Equal: {
66+
x: 12,
67+
y: 0,
68+
zones: ["pinky", "right", "digit"],
69+
},
70+
Backspace: {
71+
x: 13,
72+
y: 0,
73+
w: 2,
74+
h: 1,
75+
labels: [{ text: "Backspace" }],
76+
zones: ["pinky", "right", "digit"],
77+
},
78+
Tab: {
79+
x: 0,
80+
y: 1,
81+
w: 1.5,
82+
h: 1,
83+
labels: [{ text: "Tab" }],
84+
zones: ["pinky", "left", "top"],
85+
},
86+
KeyQ: {
87+
x: 1.5,
88+
y: 1,
89+
zones: ["pinky", "left", "top"],
90+
},
91+
KeyW: {
92+
x: 2.5,
93+
y: 1,
94+
zones: ["ring", "left", "top"],
95+
},
96+
KeyE: {
97+
x: 3.5,
98+
y: 1,
99+
zones: ["middle", "left", "top"],
100+
},
101+
KeyR: {
102+
x: 4.5,
103+
y: 1,
104+
zones: ["leftIndex", "left", "top"],
105+
},
106+
KeyT: {
107+
x: 5.5,
108+
y: 1,
109+
zones: ["leftIndex", "left", "top"],
110+
},
111+
KeyY: {
112+
x: 6.5,
113+
y: 1,
114+
zones: ["rightIndex", "right", "top"],
115+
},
116+
KeyU: {
117+
x: 7.5,
118+
y: 1,
119+
zones: ["rightIndex", "right", "top"],
120+
},
121+
KeyI: {
122+
x: 8.5,
123+
y: 1,
124+
zones: ["middle", "right", "top"],
125+
},
126+
KeyO: {
127+
x: 9.5,
128+
y: 1,
129+
zones: ["ring", "right", "top"],
130+
},
131+
KeyP: {
132+
x: 10.5,
133+
y: 1,
134+
zones: ["pinky", "right", "top"],
135+
},
136+
BracketLeft: {
137+
x: 11.5,
138+
y: 1,
139+
zones: ["pinky", "right", "top"],
140+
},
141+
BracketRight: {
142+
x: 12.5,
143+
y: 1,
144+
zones: ["pinky", "right", "top"],
145+
},
146+
Enter: {
147+
x: 13.5,
148+
y: 1,
149+
w: 1.5,
150+
h: 2,
151+
labels: [{ text: "Enter" }],
152+
shape: "m 0 0 l 0 38 l 10 0 l 0 40 l 48 0 l 0 -78 z",
153+
zones: ["pinky", "right", "top"],
154+
},
155+
CapsLock: {
156+
x: 0,
157+
y: 2,
158+
w: 1.75,
159+
h: 1,
160+
labels: [{ text: "Caps Lock" }],
161+
zones: ["pinky", "left", "home"],
162+
},
163+
KeyA: {
164+
x: 1.75,
165+
y: 2,
166+
zones: ["pinky", "left", "home"],
167+
},
168+
KeyS: {
169+
x: 2.75,
170+
y: 2,
171+
zones: ["ring", "left", "home"],
172+
},
173+
KeyD: {
174+
x: 3.75,
175+
y: 2,
176+
zones: ["middle", "left", "home"],
177+
},
178+
KeyF: {
179+
x: 4.75,
180+
y: 2,
181+
zones: ["leftIndex", "left", "home"],
182+
homing: true,
183+
},
184+
KeyG: {
185+
x: 5.75,
186+
y: 2,
187+
zones: ["leftIndex", "left", "home"],
188+
},
189+
KeyH: {
190+
x: 6.75,
191+
y: 2,
192+
zones: ["rightIndex", "right", "home"],
193+
},
194+
KeyJ: {
195+
x: 7.75,
196+
y: 2,
197+
zones: ["rightIndex", "right", "home"],
198+
homing: true,
199+
},
200+
KeyK: {
201+
x: 8.75,
202+
y: 2,
203+
zones: ["middle", "right", "home"],
204+
},
205+
KeyL: {
206+
x: 9.75,
207+
y: 2,
208+
zones: ["ring", "right", "home"],
209+
},
210+
Semicolon: {
211+
x: 10.75,
212+
y: 2,
213+
zones: ["pinky", "right", "home"],
214+
},
215+
Quote: {
216+
x: 11.75,
217+
y: 2,
218+
zones: ["pinky", "right", "home"],
219+
},
220+
Backslash: {
221+
x: 12.75,
222+
y: 2,
223+
zones: ["pinky", "right", "home"],
224+
},
225+
ShiftLeft: {
226+
x: 0,
227+
y: 3,
228+
w: 1.25,
229+
h: 1,
230+
labels: [{ text: "Shift" }],
231+
zones: ["pinky", "left", "bottom"],
232+
},
233+
IntlBackslash: {
234+
x: 1.25,
235+
y: 3,
236+
zones: ["pinky", "left", "bottom"],
237+
},
238+
KeyZ: {
239+
x: 2.25,
240+
y: 3,
241+
zones: ["ring", "left", "bottom"],
242+
},
243+
KeyX: {
244+
x: 3.25,
245+
y: 3,
246+
zones: ["middle", "left", "bottom"],
247+
},
248+
KeyC: {
249+
x: 4.25,
250+
y: 3,
251+
zones: ["leftIndex", "left", "bottom"],
252+
},
253+
KeyV: {
254+
x: 5.25,
255+
y: 3,
256+
zones: ["leftIndex", "left", "bottom"],
257+
},
258+
KeyB: {
259+
x: 6.25,
260+
y: 3,
261+
zones: ["leftIndex", "left", "bottom"],
262+
},
263+
KeyN: {
264+
x: 7.25,
265+
y: 3,
266+
zones: ["rightIndex", "right", "bottom"],
267+
},
268+
KeyM: {
269+
x: 8.25,
270+
y: 3,
271+
zones: ["rightIndex", "right", "bottom"],
272+
},
273+
Comma: {
274+
x: 9.25,
275+
y: 3,
276+
zones: ["middle", "right", "bottom"],
277+
},
278+
Period: {
279+
x: 10.25,
280+
y: 3,
281+
zones: ["ring", "right", "bottom"],
282+
},
283+
Slash: {
284+
x: 11.25,
285+
y: 3,
286+
zones: ["pinky", "right", "bottom"],
287+
},
288+
ShiftRight: {
289+
x: 12.25,
290+
y: 3,
291+
w: 2.75,
292+
h: 1,
293+
labels: [{ text: "Shift" }],
294+
zones: ["pinky", "right", "bottom"],
295+
},
296+
ControlLeft: {
297+
x: 0,
298+
y: 4,
299+
w: 1.5,
300+
h: 1,
301+
labels: [{ text: "Ctrl" }],
302+
zones: ["pinky", "left", "bottom"],
303+
},
304+
AltLeft: {
305+
x: 1.5,
306+
y: 4,
307+
w: 1.5,
308+
h: 1,
309+
labels: [{ text: "Alt" }],
310+
zones: ["pinky", "left", "bottom"],
311+
},
312+
Space: {
313+
x: 3,
314+
y: 4,
315+
w: 9,
316+
h: 1,
317+
zones: ["thumb", "right", "bottom"],
318+
},
319+
AltRight: {
320+
x: 12,
321+
y: 4,
322+
w: 1.5,
323+
h: 1,
324+
labels: [{ text: "Alt" }],
325+
zones: ["pinky", "right", "bottom"],
326+
},
327+
ControlRight: {
328+
x: 13.5,
329+
y: 4,
330+
w: 1.5,
331+
h: 1,
332+
labels: [{ text: "Ctrl" }],
333+
zones: ["pinky", "right", "bottom"],
334+
},
335+
};

packages/keybr-keyboard/lib/layout.ts

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export class Layout implements XEnumItem {
1616
Geometry.ANSI_101_FULL,
1717
Geometry.ISO_102,
1818
Geometry.ISO_102_FULL,
19+
Geometry.ISO_102_SYMMETRIC,
1920
Geometry.MATRIX,
2021
),
2122
);

packages/keybr-keyboard/lib/load.ts

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { BRAZILIAN_104 } from "./geometry/brazilian_104.ts";
55
import { BRAZILIAN_104_FULL } from "./geometry/brazilian_104_full.ts";
66
import { ISO_102 } from "./geometry/iso_102.ts";
77
import { ISO_102_FULL } from "./geometry/iso_102_full.ts";
8+
import { ISO_102_SYMMETRIC } from "./geometry/iso_102_symmetric.ts";
89
import { JAPANESE_106 } from "./geometry/japanese_106.ts";
910
import { JAPANESE_106_FULL } from "./geometry/japanese_106_full.ts";
1011
import { KOREAN_103 } from "./geometry/korean_103.ts";
@@ -161,6 +162,7 @@ const geometryDict = new Map<Geometry, GeometryDict>([
161162
[Geometry.BRAZILIAN_104_FULL, BRAZILIAN_104_FULL],
162163
[Geometry.ISO_102, ISO_102],
163164
[Geometry.ISO_102_FULL, ISO_102_FULL],
165+
[Geometry.ISO_102_SYMMETRIC, ISO_102_SYMMETRIC],
164166
[Geometry.JAPANESE_106, JAPANESE_106],
165167
[Geometry.JAPANESE_106_FULL, JAPANESE_106_FULL],
166168
[Geometry.KOREAN_103, KOREAN_103],

0 commit comments

Comments
 (0)