Skip to content

Commit 12d31a3

Browse files
authored
Add da_DK keyboard Layout (#839)
1 parent 657a177 commit 12d31a3

File tree

2 files changed

+189
-1
lines changed

2 files changed

+189
-1
lines changed

ui/src/keyboardLayouts.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ import { fr_FR } from "@/keyboardLayouts/fr_FR"
2727
import { it_IT } from "@/keyboardLayouts/it_IT"
2828
import { nb_NO } from "@/keyboardLayouts/nb_NO"
2929
import { sv_SE } from "@/keyboardLayouts/sv_SE"
30+
import { da_DK } from "@/keyboardLayouts/da_DK"
3031

31-
export const keyboards: KeyboardLayout[] = [ cs_CZ, de_CH, de_DE, en_UK, en_US, es_ES, fr_BE, fr_CH, fr_FR, it_IT, nb_NO, sv_SE ];
32+
export const keyboards: KeyboardLayout[] = [ cs_CZ, de_CH, de_DE, en_UK, en_US, es_ES, fr_BE, fr_CH, fr_FR, it_IT, nb_NO, sv_SE, da_DK ];

ui/src/keyboardLayouts/da_DK.ts

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
import { KeyboardLayout, KeyCombo } from "../keyboardLayouts"
2+
3+
import { en_US } from "./en_US" // for fallback of keyDisplayMap, modifierDisplayMap, and virtualKeyboard
4+
5+
export const name = "Dansk";
6+
const isoCode = "da-DK";
7+
8+
const keyTrema = { key: "BracketRight" }
9+
const keyAcute = { key: "Equal", altRight: true }
10+
const keyHat = { key: "BracketRight", shift: true }
11+
const keyGrave = { key: "Equal", shift: true }
12+
const keyTilde = { key: "BracketRight", altRight: true }
13+
14+
export const chars = {
15+
A: { key: "KeyA", shift: true },
16+
"Ä": { key: "KeyA", shift: true, accentKey: keyTrema },
17+
"Á": { key: "KeyA", shift: true, accentKey: keyAcute },
18+
"Â": { key: "KeyA", shift: true, accentKey: keyHat },
19+
"À": { key: "KeyA", shift: true, accentKey: keyGrave },
20+
"Ã": { key: "KeyA", shift: true, accentKey: keyTilde },
21+
B: { key: "KeyB", shift: true },
22+
C: { key: "KeyC", shift: true },
23+
D: { key: "KeyD", shift: true },
24+
E: { key: "KeyE", shift: true },
25+
"Ë": { key: "KeyE", shift: true, accentKey: keyTrema },
26+
"É": { key: "KeyE", shift: true, accentKey: keyAcute },
27+
"Ê": { key: "KeyE", shift: true, accentKey: keyHat },
28+
"È": { key: "KeyE", shift: true, accentKey: keyGrave },
29+
"Ẽ": { key: "KeyE", shift: true, accentKey: keyTilde },
30+
F: { key: "KeyF", shift: true },
31+
G: { key: "KeyG", shift: true },
32+
H: { key: "KeyH", shift: true },
33+
I: { key: "KeyI", shift: true },
34+
"Ï": { key: "KeyI", shift: true, accentKey: keyTrema },
35+
"Í": { key: "KeyI", shift: true, accentKey: keyAcute },
36+
"Î": { key: "KeyI", shift: true, accentKey: keyHat },
37+
"Ì": { key: "KeyI", shift: true, accentKey: keyGrave },
38+
"Ĩ": { key: "KeyI", shift: true, accentKey: keyTilde },
39+
J: { key: "KeyJ", shift: true },
40+
K: { key: "KeyK", shift: true },
41+
L: { key: "KeyL", shift: true },
42+
M: { key: "KeyM", shift: true },
43+
N: { key: "KeyN", shift: true },
44+
O: { key: "KeyO", shift: true },
45+
"Ö": { key: "KeyO", shift: true, accentKey: keyTrema },
46+
"Ó": { key: "KeyO", shift: true, accentKey: keyAcute },
47+
"Ô": { key: "KeyO", shift: true, accentKey: keyHat },
48+
"Ò": { key: "KeyO", shift: true, accentKey: keyGrave },
49+
"Õ": { key: "KeyO", shift: true, accentKey: keyTilde },
50+
P: { key: "KeyP", shift: true },
51+
Q: { key: "KeyQ", shift: true },
52+
R: { key: "KeyR", shift: true },
53+
S: { key: "KeyS", shift: true },
54+
T: { key: "KeyT", shift: true },
55+
U: { key: "KeyU", shift: true },
56+
"Ü": { key: "KeyU", shift: true, accentKey: keyTrema },
57+
"Ú": { key: "KeyU", shift: true, accentKey: keyAcute },
58+
"Û": { key: "KeyU", shift: true, accentKey: keyHat },
59+
"Ù": { key: "KeyU", shift: true, accentKey: keyGrave },
60+
"Ũ": { key: "KeyU", shift: true, accentKey: keyTilde },
61+
V: { key: "KeyV", shift: true },
62+
W: { key: "KeyW", shift: true },
63+
X: { key: "KeyX", shift: true },
64+
Y: { key: "KeyY", shift: true },
65+
Z: { key: "KeyZ", shift: true },
66+
a: { key: "KeyA" },
67+
"ä": { key: "KeyA", accentKey: keyTrema },
68+
"á": { key: "KeyA", accentKey: keyAcute },
69+
"â": { key: "KeyA", accentKey: keyHat },
70+
"à": { key: "KeyA", accentKey: keyGrave },
71+
"ã": { key: "KeyA", accentKey: keyTilde },
72+
b: { key: "KeyB" },
73+
c: { key: "KeyC" },
74+
d: { key: "KeyD" },
75+
e: { key: "KeyE" },
76+
"ë": { key: "KeyE", accentKey: keyTrema },
77+
"é": { key: "KeyE", accentKey: keyAcute },
78+
"ê": { key: "KeyE", accentKey: keyHat },
79+
"è": { key: "KeyE", accentKey: keyGrave },
80+
"ẽ": { key: "KeyE", accentKey: keyTilde },
81+
"€": { key: "KeyE", altRight: true },
82+
f: { key: "KeyF" },
83+
g: { key: "KeyG" },
84+
h: { key: "KeyH" },
85+
i: { key: "KeyI" },
86+
"ï": { key: "KeyI", accentKey: keyTrema },
87+
"í": { key: "KeyI", accentKey: keyAcute },
88+
"î": { key: "KeyI", accentKey: keyHat },
89+
"ì": { key: "KeyI", accentKey: keyGrave },
90+
"ĩ": { key: "KeyI", accentKey: keyTilde },
91+
j: { key: "KeyJ" },
92+
k: { key: "KeyK" },
93+
l: { key: "KeyL" },
94+
m: { key: "KeyM" },
95+
n: { key: "KeyN" },
96+
o: { key: "KeyO" },
97+
"ö": { key: "KeyO", accentKey: keyTrema },
98+
"ó": { key: "KeyO", accentKey: keyAcute },
99+
"ô": { key: "KeyO", accentKey: keyHat },
100+
"ò": { key: "KeyO", accentKey: keyGrave },
101+
"õ": { key: "KeyO", accentKey: keyTilde },
102+
p: { key: "KeyP" },
103+
q: { key: "KeyQ" },
104+
r: { key: "KeyR" },
105+
s: { key: "KeyS" },
106+
t: { key: "KeyT" },
107+
u: { key: "KeyU" },
108+
"ü": { key: "KeyU", accentKey: keyTrema },
109+
"ú": { key: "KeyU", accentKey: keyAcute },
110+
"û": { key: "KeyU", accentKey: keyHat },
111+
"ù": { key: "KeyU", accentKey: keyGrave },
112+
"ũ": { key: "KeyU", accentKey: keyTilde },
113+
v: { key: "KeyV" },
114+
w: { key: "KeyW" },
115+
x: { key: "KeyX" },
116+
y: { key: "KeyY" }, // <-- corrected
117+
z: { key: "KeyZ" }, // <-- corrected
118+
"½": { key: "Backquote" },
119+
"§": { key: "Backquote", shift: true },
120+
1: { key: "Digit1" },
121+
"!": { key: "Digit1", shift: true },
122+
2: { key: "Digit2" },
123+
"\"": { key: "Digit2", shift: true },
124+
"@": { key: "Digit2", altRight: true },
125+
3: { key: "Digit3" },
126+
"#": { key: "Digit3", shift: true },
127+
"£": { key: "Digit3", altRight: true },
128+
4: { key: "Digit4" },
129+
"¤": { key: "Digit4", shift: true },
130+
"$": { key: "Digit4", altRight: true },
131+
5: { key: "Digit5" },
132+
"%": { key: "Digit5", shift: true },
133+
6: { key: "Digit6" },
134+
"&": { key: "Digit6", shift: true },
135+
7: { key: "Digit7" },
136+
"/": { key: "Digit7", shift: true },
137+
"{": { key: "Digit7", altRight: true },
138+
8: { key: "Digit8" },
139+
"(": { key: "Digit8", shift: true },
140+
"[": { key: "Digit8", altRight: true },
141+
9: { key: "Digit9" },
142+
")": { key: "Digit9", shift: true },
143+
"]": { key: "Digit9", altRight: true },
144+
0: { key: "Digit0" },
145+
"=": { key: "Digit0", shift: true },
146+
"}": { key: "Digit0", altRight: true },
147+
"+": { key: "Minus" },
148+
"?": { key: "Minus", shift: true },
149+
"\\": { key: "Equal" },
150+
"å": { key: "BracketLeft" },
151+
"Å": { key: "BracketLeft", shift: true },
152+
"ø": { key: "Semicolon" },
153+
"Ø": { key: "Semicolon", shift: true },
154+
"æ": { key: "Quote" },
155+
"Æ": { key: "Quote", shift: true },
156+
"'": { key: "Backslash" },
157+
"*": { key: "Backslash", shift: true },
158+
",": { key: "Comma" },
159+
";": { key: "Comma", shift: true },
160+
".": { key: "Period" },
161+
":": { key: "Period", shift: true },
162+
"-": { key: "Slash" },
163+
"_": { key: "Slash", shift: true },
164+
"<": { key: "IntlBackslash" },
165+
">": { key: "IntlBackslash", shift: true },
166+
"~": { key: "BracketRight", deadKey: true, altRight: true },
167+
"^": { key: "BracketRight", deadKey: true, shift: true },
168+
"¨": { key: "BracketRight", deadKey: true, },
169+
"|": { key: "Equal", deadKey: true, altRight: true},
170+
"`": { key: "Equal", deadKey: true, shift: true, },
171+
"´": { key: "Equal", deadKey: true, },
172+
" ": { key: "Space" },
173+
"\n": { key: "Enter" },
174+
Enter: { key: "Enter" },
175+
Tab: { key: "Tab" },
176+
177+
} as Record<string, KeyCombo>;
178+
179+
export const da_DK: KeyboardLayout = {
180+
isoCode: isoCode,
181+
name: name,
182+
chars: chars,
183+
// TODO need to localize these maps and layouts
184+
keyDisplayMap: en_US.keyDisplayMap,
185+
modifierDisplayMap: en_US.modifierDisplayMap,
186+
virtualKeyboard: en_US.virtualKeyboard
187+
};

0 commit comments

Comments
 (0)