Skip to content

Commit 27b09b5

Browse files
Erglace + Colemak FT + Bépolar + Lafayette (#94)
* `keebs` refacto + lafayette.md * quick bugfixes * drop unused SVG files * release the Lafayette powwa
1 parent d46544c commit 27b09b5

24 files changed

+1779
-2013
lines changed

code/duck-typist.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,9 @@ window.addEventListener('DOMContentLoaded', () => {
276276
};
277277

278278
window.addEventListener('hashchange', loadLayout);
279-
gLayout.addEventListener('change', loadLayout);
279+
gLayout.addEventListener('change', () => {
280+
window.location.hash = `#${gLayout.value}`;
281+
});
280282

281283
gDict.addEventListener('change', () => {
282284
localStorage.setItem('dict', gDict.value);

code/demo.js renamed to code/keebs.js

Lines changed: 55 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,55 @@
1+
/**
2+
* <div class="keyboard">
3+
* <img src="/img/ergol.svg"> <!-- replaced by an <svg> element -->
4+
* <p>
5+
* <span>powered by <a
6+
* href="https://github.com/OneDeadKey/x-keyboard">x-keyboard</a></span>
7+
* <small>géométrie :</small>
8+
* <select> <!-- filled when the <svg> is created -->
9+
* <option value="dk iso">ISO</option>
10+
* </select>
11+
* </p>
12+
* <dialog>
13+
* <input></input>
14+
* <x-keyboard></x-keyboard>
15+
* </dialog>
16+
* </div>
17+
*/
18+
119
window.addEventListener('DOMContentLoaded', () => {
220
'use strict'; // eslint-disable-line
321

4-
const dialog = document.querySelector('dialog');
5-
const keyboard = document.querySelector('x-keyboard');
6-
const input = document.querySelector('input');
7-
const geometry = document.querySelector('.keyboard select');
8-
const button = document.querySelector('.keyboard button');
22+
for (const keeb of document.querySelectorAll('.keyboard')) {
23+
console.log(keeb);
924

10-
if (!keyboard.layout) {
11-
console.warn('web components are not supported');
12-
return; // the web component has not been loaded
13-
}
25+
const dialog = keeb.querySelector('dialog');
26+
const keyboard = keeb.querySelector('x-keyboard');
27+
const preview = keeb.querySelector('img');
28+
const input = keeb.querySelector('input');
29+
const geometry = keeb.querySelector('select');
30+
const button = keeb.querySelector('button');
1431

1532
const getGeometry = () => geometry.value.split(' ')[1];
1633

34+
fetch(preview.getAttribute('src'))
35+
.then(response => response.text())
36+
.then(data => {
37+
preview.outerHTML = data;
38+
geometry.innerHTML = `
39+
<option value="dk iso intlBackslash am"> ISO-A </option>
40+
<option value="dk iso intlBackslash" selected> ISO </option>
41+
<option value="dk ansi"> ANSI </option>
42+
<option value="dk ol60 ergo"> TMx </option>
43+
<option value="dk ol50 ergo"> 4×6 </option>
44+
<option value="dk ol40 ergo"> 3×6 </option>
45+
`;
46+
const svg = keeb.querySelector('.keyboard svg');
47+
geometry.addEventListener('change', event => {
48+
svg.setAttribute('class', event.target.value);
49+
keyboard.geometry = getGeometry();
50+
});
51+
});
52+
1753
fetch(keyboard.getAttribute('src'))
1854
.then(response => response.json() )
1955
.then(data => {
@@ -23,9 +59,14 @@ window.addEventListener('DOMContentLoaded', () => {
2359
if (button) button.disabled = false;
2460
});
2561

26-
geometry.addEventListener('change', event => {
27-
keyboard.geometry = getGeometry();
28-
});
62+
if (!keyboard.layout) {
63+
console.warn('web components are not supported');
64+
return; // the web component has not been loaded
65+
}
66+
67+
if (!input) {
68+
return;
69+
}
2970

3071
/**
3172
* Open/Close modal
@@ -95,4 +136,6 @@ window.addEventListener('DOMContentLoaded', () => {
95136
event.target.value = event.target.value.slice(0, -event.data.length);
96137
}
97138
});
139+
}
140+
98141
});

code/svg.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

layouts/bepolar.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Bépolar
2+
name8: bepolar
3+
locale: fr
4+
variant: bepolar
5+
description: French (Bépolar)
6+
url: https://github.com/Ced-C/Bepolar
7+
author : Cèd’C
8+
geometry: ERGO
9+
version: 0.6.0
10+
11+
base: |
12+
╭╌╌╌╌╌┰─────┬─────┬─────┬─────┬─────┰─────┬─────┬─────┬─────┬─────┰╌╌╌╌╌┬╌╌╌╌╌╮
13+
┆ ¬ ┃ # │ « “ │ » ” │ ( „ │ ) ‘ ┃ @ │ + ÷ │ ^*ˇ │ / | │ * × ┃*µ ┆ § ¶ ┆
14+
┆ ~*~ ┃ 1 & │ 2 < │ 3 > │ 4 ( │ 5 ) ┃ 6 @ │ 7 ± │ 8*^ │ 9 \ │ 0 ° ┃ = ≠ ┆ % ‰ ┆
15+
╰╌╌╌╌╌╂─────┼─────┼─────┼─────┼─────╂─────┼─────┼─────┼─────┼─────╂╌╌╌╌╌┼╌╌╌╌╌┤
16+
· ┃ B │ M │ P │ O │ W ┃ Z │ V │ D │ L │ J ┃ { ┆ } ┆
17+
· ┃ â │ û │ î │ ô │ œ ┃ │ ŭ │ │ │ ┃ [ ┆ ] ┆
18+
· ┠─────┼─────┼─────┼─────┼─────╂─────┼─────┼─────┼─────┼─────╂╌╌╌╌╌┼╌╌╌╌╌┤
19+
· ┃ A │ U │ I │ E │ ; ┃ C │ T │ S │ R │ N ┃ " ┆ €*¤ ┆
20+
· ┃ à │ ù │ é │ è │ , ê ┃ ç │ ™ │ ß │ ® │ ñ ┃ ' ` ┆ $ ¢ ┆
21+
╭╌╌╌╌╌╂─────┼─────┼─────┼─────┼─────╂─────┼─────┼─────┼─────┼─────╂╌╌╌╌╌┴╌╌╌╌╌╯
22+
┆ \ ¦ ┃ ! ¡ │ Y │ X │ : · │ K ┃ ? ¿ │ Q │ G │ H │ F ┃ ·
23+
┆ / | ┃ - — │ ŷ │ _ │ . … │ æ ┃***¨ │ – │ µ │ © │ ┃ ·
24+
╰╌╌╌╌╌┸─────┴─────┴─────┴─────┴─────┸─────┴─────┴─────┴─────┴─────┚ · · · · · ·
25+
26+
altgr: |
27+
╭╌╌╌╌╌┰─────┬─────┬─────┬─────┬─────┰─────┬─────┬─────┬─────┬─────┰╌╌╌╌╌┬╌╌╌╌╌╮
28+
┆ ┃ ¹ │ ² │ ³ │ ⁴ │ ⁵ ┃ ⁶ │ ⁷ │ ⁸ │ ⁹ │ ⁰ ┃ ┆ ┆
29+
┆ ₍ ┃ ₁ │ ₂ │ ₃ │ ₄ │ ₅ ┃ ₆ │ ₇ │ ₈ │ ₉ │ ₀ ┃ ₎ ┆ ┆
30+
╰╌╌╌╌╌╂─────┼─────┼─────┼─────┼─────╂─────┼─────┼─────┼─────┼─────╂╌╌╌╌╌┼╌╌╌╌╌┤
31+
· ┃ │ ≤ │ ≥ │ *¤ │ ‰ ┃ *^ │ *µ │ × │ *´ │ *` ┃ ┆ ┆
32+
· ┃ @ │ < │ > │ $ │ % ┃ ^ │ & │ * │ ' │ ` ┃ ┆ ┆
33+
· ┠─────┼─────┼─────┼─────┼─────╂─────┼─────┼─────┼─────┼─────╂╌╌╌╌╌┼╌╌╌╌╌┤
34+
· ┃ │ ⁽ │ ⁾ │ │ ≠ ┃ */ │ ± │ — │ ÷ │ *¨ ┃*ˇ ┆ *¤ ┆
35+
· ┃ { │ ( │ ) │ } │ = ┃ \ │ + │ - │ / │ " ┃ ┆ ¤ ┆
36+
╭╌╌╌╌╌╂─────┼─────┼─────┼─────┼─────╂─────┼─────┼─────┼─────┼─────╂╌╌╌╌╌┴╌╌╌╌╌╯
37+
┆ ┃ *~ │ │ │ – │ ┃ ¦ │ ¬ │ *¸ │ │ ┃ ·
38+
┆ ┃ ~ │ [ │ ] │ _ │ # ┃ | │ ! │ ; │ : │ ? ┃ ·
39+
╰╌╌╌╌╌┸─────┴─────┴─────┴─────┴─────┸─────┴─────┴─────┴─────┴─────┚ · · · · · ·
40+
41+
42+
spacebar:
43+
shift: "\u202f" # NARROW NO-BREAK SPACE
44+
altgr: "\u0020" # SPACE
45+
altgr_shift: "\u00a0" # NO-BREAK SPACE
46+
1dk: "\u2019" # RIGHT SINGLE QUOTATION MARK
47+
1dk_shift: "\u2019" # RIGHT SINGLE QUOTATION MARK

layouts/colemak-french-touch.json

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"name": "Colemak French Touch",
3+
"description": "French (Colemak French Touch)",
4+
"geometry": "ergo",
5+
"keymap": {
6+
"Digit1": [ "1", "", "", "¹" ],
7+
"Digit2": [ "2", "@", "", "²" ],
8+
"Digit3": [ "3", "#", "", "³" ],
9+
"Digit4": [ "4", "$", "", "" ],
10+
"Digit5": [ "5", "%", "", "" ],
11+
"Digit6": [ "6", "^", "", "" ],
12+
"Digit7": [ "7", "&", "", "" ],
13+
"Digit8": [ "8", "*", "", "" ],
14+
"Digit9": [ "9", "«", "", "" ],
15+
"Digit0": [ "0", "»", "", "" ],
16+
"KeyQ": [ "q", "Q", "@" ],
17+
"KeyW": [ "w", "W", "<", "" ],
18+
"KeyE": [ "f", "F", ">", "" ],
19+
"KeyR": [ "p", "P", "$", "" ],
20+
"KeyT": [ "g", "G", "%", "" ],
21+
"KeyY": [ "j", "J", "^", "*^" ],
22+
"KeyU": [ "l", "L", "&" ],
23+
"KeyI": [ "o", "O", "*", "×" ],
24+
"KeyO": [ "**", "!", "'", "" ],
25+
"KeyP": [ "y", "Y", "`", "*`" ],
26+
"KeyA": [ "a", "A", "{" ],
27+
"KeyS": [ "r", "R", "(", "" ],
28+
"KeyD": [ "s", "S", ")", "" ],
29+
"KeyF": [ "t", "T", "}" ],
30+
"KeyG": [ "d", "D", "=", "" ],
31+
"KeyH": [ "m", "M", "\\", "*/" ],
32+
"KeyJ": [ "n", "N", "+", "±" ],
33+
"KeyK": [ "e", "E", "-", "" ],
34+
"KeyL": [ "i", "I", "/", "÷" ],
35+
"Semicolon": [ "u", "U", "\"", "" ],
36+
"KeyZ": [ "z", "Z", "~", "*~" ],
37+
"KeyX": [ "x", "X", "[" ],
38+
"KeyC": [ "c", "C", "]" ],
39+
"KeyV": [ "v", "V", "_", "" ],
40+
"KeyB": [ "b", "B", "#" ],
41+
"KeyN": [ "k", "K", "|", "¦" ],
42+
"KeyM": [ "h", "H", "!", "¬" ],
43+
"Comma": [ "-", "?", ";", "" ],
44+
"Period": [ ",", ";", ":" ],
45+
"Slash": [ ".", ":", "?" ],
46+
"Minus": [ "/", "_" ],
47+
"Equal": [ "=", "+" ],
48+
"BracketLeft": [ "[", "{" ],
49+
"BracketRight": [ "]", "}" ],
50+
"Quote": [ "'", "\"" ],
51+
"Backquote": [ "`", "~" ],
52+
"Backslash": [ "\\", "|" ],
53+
"IntlBackslash": [ "<", ">" ],
54+
"Space": [ " ", "", " ", " " ]
55+
},
56+
"deadkeys": {
57+
"**": { "**": "", "0": "°", "F": "À", "f": "à", "P": "Ù", "p": "ù", "L": "Œ", "l": "œ", "O": "Ô", "o": "ô", "Y": "Î", "y": "î", "A": "Â", "a": "â", "R": "É", "r": "é", "S": "È", "s": "è", "d": "", "m": "(", "n": ")", "E": "Ê", "e": "ê", "U": "Û", "u": "û", "Z": "Æ", "z": "æ", "C": "Ç", "c": "ç", "V": "_", "v": "_", "b": "", "k": "", "h": "", "-": "", ":": "", ".": "·", " ": "", " ": "", " ": "" },
58+
"*`": { "*`": "`", "A": "À", "a": "à", "E": "È", "e": "è", "I": "Ì", "i": "ì", "N": "Ǹ", "n": "ǹ", "O": "Ò", "o": "ò", "U": "Ù", "u": "ù", "W": "", "w": "", "Y": "", "y": "", " ": "`", " ": "`", " ": "`" },
59+
"*´": { "*´": "´", "A": "Á", "a": "á", "C": "Ć", "c": "ć", "E": "É", "e": "é", "G": "Ǵ", "g": "ǵ", "I": "Í", "i": "í", "K": "", "k": "", "L": "Ĺ", "l": "ĺ", "M": "", "m": "ḿ", "N": "Ń", "n": "ń", "O": "Ó", "o": "ó", "P": "", "p": "", "R": "Ŕ", "r": "ŕ", "S": "Ś", "s": "ś", "U": "Ú", "u": "ú", "W": "", "w": "", "Y": "Ý", "y": "ý", "Z": "Ź", "z": "ź", " ": "'", " ": "'", " ": "'" },
60+
"*^": { "*^": "^", "A": "Â", "a": "â", "C": "Ĉ", "c": "ĉ", "E": "Ê", "e": "ê", "G": "Ĝ", "g": "ĝ", "H": "Ĥ", "h": "ĥ", "I": "Î", "i": "î", "J": "Ĵ", "j": "ĵ", "O": "Ô", "o": "ô", "S": "Ŝ", "s": "ŝ", "U": "Û", "u": "û", "W": "Ŵ", "w": "ŵ", "Y": "Ŷ", "y": "ŷ", "Z": "", "z": "", "0": "", "1": "¹", "2": "²", "3": "³", "4": "", "5": "", "6": "", "7": "", "8": "", "9": "", "(": "", ")": "", "+": "", "-": "", "=": "", " ": "^", " ": "^", " ": "^" },
61+
"*~": { "*~": "~", "A": "Ã", "a": "ã", "E": "", "e": "", "I": "Ĩ", "i": "ĩ", "N": "Ñ", "n": "ñ", "O": "Õ", "o": "õ", "U": "Ũ", "u": "ũ", "V": "", "v": "", "Y": "", "y": "", "<": "", ">": "", "=": "", " ": "~", " ": "~", " ": "~" },
62+
"*¨": { "*¨": "¨", "A": "Ä", "a": "ä", "E": "Ë", "e": "ë", "H": "", "h": "", "I": "Ï", "i": "ï", "O": "Ö", "o": "ö", "t": "", "U": "Ü", "u": "ü", "W": "", "w": "", "X": "", "x": "", "Y": "Ÿ", "y": "ÿ", " ": "\"", " ": "\"", " ": "\"" },
63+
"*¸": { "*¸": "¸", "C": "Ç", "c": "ç", "D": "", "d": "", "E": "Ȩ", "e": "ȩ", "G": "Ģ", "g": "ģ", "H": "", "h": "", "K": "Ķ", "k": "ķ", "L": "Ļ", "l": "ļ", "N": "Ņ", "n": "ņ", "R": "Ŗ", "r": "ŗ", "S": "Ş", "s": "ş", "T": "Ţ", "t": "ţ", " ": "¸", " ": "¸", " ": "¸" },
64+
"*/": { "*/": "/", "A": "Ⱥ", "a": "", "B": "Ƀ", "b": "ƀ", "C": "Ȼ", "c": "ȼ", "D": "Đ", "d": "đ", "E": "Ɇ", "e": "ɇ", "G": "Ǥ", "g": "ǥ", "H": "Ħ", "h": "ħ", "I": "Ɨ", "i": "ɨ", "J": "Ɉ", "j": "ɉ", "L": "Ł", "l": "ł", "O": "Ø", "o": "ø", "P": "", "p": "", "R": "Ɍ", "r": "ɍ", "T": "Ŧ", "t": "ŧ", "U": "Ʉ", "u": "ʉ", "Y": "Ɏ", "y": "ɏ", "Z": "Ƶ", "z": "ƶ", "<": "", "≤": "", "≥": "", ">": "", "=": "", " ": "/", " ": "/", " ": "/" },
65+
"*¤": { "*¤": "¤", "A": "", "a": "؋", "B": "", "b": "฿", "C": "", "c": "¢", "D": "", "d": "", "E": "", "e": "", "F": "", "f": "ƒ", "G": "", "g": "", "H": "", "h": "", "I": "", "i": "", "K": "", "k": "", "L": "", "l": "£", "M": "", "m": "", "N": "", "n": "", "O": "", "o": "", "P": "", "p": "", "R": "", "r": "", "S": "$", "s": "", "T": "", "t": "", "U": "", "u": "", "W": "", "w": "", "Y": "", "y": "¥", " ": "¤", " ": "¤", " ": "¤" }
66+
},
67+
"altgr": true
68+
}

layouts/colemak-french-touch.toml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name = "Colemak French Touch"
2+
name8 = "colemkft"
3+
locale = "fr"
4+
variant = "colemkft"
5+
description = "French (Colemak French Touch)"
6+
author = "Cedric Rossi"
7+
url = "https://github.com/cedricr/colemak-french-touch"
8+
geometry = "ERGO"
9+
version = "0.3.1"
10+
11+
base = '''
12+
╭╌╌╌╌╌┰─────┬─────┬─────┬─────┬─────┰─────┬─────┬─────┬─────┬─────┰╌╌╌╌╌┬╌╌╌╌╌╮
13+
┆ ~ ┃ € │ @ │ # │ $ │ % ┃ ^ │ & │ * │ « │ » ┃ _ ┆ + ┆
14+
┆ ` ┃ 1 │ 2 │ 3 │ 4 │ 5 ┃ 6 │ 7 │ 8 │ 9 │ 0 ° ┃ / ┆ = ┆
15+
╰╌╌╌╌╌╂─────┼─────┼─────┼─────┼─────╂─────┼─────┼─────┼─────┼─────╂╌╌╌╌╌┼╌╌╌╌╌┤
16+
· ┃ Q │ W │ F │ P │ G ┃ J │ L │ O │ ! │ Y ┃ { ┆ } ┆
17+
· ┃ │ │ à │ ù │ ┃ │ œ │ ô │***¨ │ î ┃ [ ┆ ] ┆
18+
· ┠─────┼─────┼─────┼─────┼─────╂─────┼─────┼─────┼─────┼─────╂╌╌╌╌╌┼╌╌╌╌╌┤
19+
· ┃ A │ R │ S │ T │ D ┃ M │ N │ E │ I │ U ┃ " ┆ | ┆
20+
· ┃ â │ é │ è │ │ – ┃ ( │ ) │ ê │ │ û ┃ ' ┆ \ ┆
21+
╭╌╌╌╌╌╂─────┼─────┼─────┼─────┼─────╂─────┼─────┼─────┼─────┼─────╂╌╌╌╌╌┴╌╌╌╌╌╯
22+
┆ > ┃ Z │ X │ C │ V _ │ B ┃ K │ H │ ? │ ; │ : • ┃ ·
23+
┆ < ┃ æ │ │ ç │ _ │ — ┃ “ │ ” │ - … │ , │ . · ┃ ·
24+
╰╌╌╌╌╌┸─────┴─────┴─────┴─────┴─────┸─────┴─────┴─────┴─────┴─────┚ · · · · · ·
25+
'''
26+
27+
altgr = '''
28+
╭╌╌╌╌╌┰─────┬─────┬─────┬─────┬─────┰─────┬─────┬─────┬─────┬─────┰╌╌╌╌╌┬╌╌╌╌╌╮
29+
┆ ┃ ¹ │ ² │ ³ │ ⁴ │ ⁵ ┃ ⁶ │ ⁷ │ ⁸ │ ⁹ │ ⁰ ┃ ┆ ┆
30+
┆ ┃ ₁ │ ₂ │ ₃ │ ₄ │ ₅ ┃ ₆ │ ₇ │ ₈ │ ₉ │ ₀ ┃ ┆ ┆
31+
╰╌╌╌╌╌╂─────┼─────┼─────┼─────┼─────╂─────┼─────┼─────┼─────┼─────╂╌╌╌╌╌┼╌╌╌╌╌┤
32+
· ┃ │ ≤ │ ≥ │ *¤ │ ‰ ┃ *^ │ │ × │ *´ │ *` ┃ ┆ ┆
33+
· ┃ @ │ < │ > │ $ │ % ┃ ^ │ & │ * │ ' │ ` ┃ ┆ ┆
34+
· ┠─────┼─────┼─────┼─────┼─────╂─────┼─────┼─────┼─────┼─────╂╌╌╌╌╌┼╌╌╌╌╌┤
35+
· ┃ │ ⁽ │ ⁾ │ │ ≠ ┃ */ │ ± │ — │ ÷ │ *¨ ┃ ┆ ┆
36+
· ┃ { │ ( │ ) │ } │ = ┃ \ │ + │ - │ / │ " ┃ ┆ ┆
37+
╭╌╌╌╌╌╂─────┼─────┼─────┼─────┼─────╂─────┼─────┼─────┼─────┼─────╂╌╌╌╌╌┴╌╌╌╌╌╯
38+
┆ ┃ *~ │ │ │ – │ ┃ ¦ │ ¬ │ *¸ │ │ ┃ ·
39+
┆ ┃ ~ │ [ │ ] │ _ │ # ┃ | │ ! │ ; │ : │ ? ┃ ·
40+
╰╌╌╌╌╌┸─────┴─────┴─────┴─────┴─────┸─────┴─────┴─────┴─────┴─────┚ · · · · · ·
41+
'''
42+
43+
[spacebar]
44+
shift = "\u202f" # NARROW NO-BREAK SPACE
45+
altgr = "\u0020" # SPACE
46+
altgr_shift = "\u00a0" # NO-BREAK SPACE
47+
1dk = "\u2019" # RIGHT SINGLE QUOTATION MARK
48+
1dk_shift = "\u2019" # RIGHT SINGLE QUOTATION MARK

0 commit comments

Comments
 (0)