Skip to content

Commit

Permalink
layouts : en, fr, fr.contrib, fr.nonfree (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienm7 authored Nov 11, 2024
1 parent f91cb74 commit e078a83
Show file tree
Hide file tree
Showing 49 changed files with 832 additions and 15 deletions.
14 changes: 5 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
all:
@for file in layouts/*.toml; do \
kalamine build $$file --out "layouts/$$(basename $${file%.*}).json"; \
done
@for file in layouts/*.yaml; do \
kalamine build $$file --out "layouts/$$(basename $${file%.*}).json"; \
@find layouts -type f \( -name '*.toml' -o -name '*.yaml' \) | while read -r file; do \
kalamine build "$$file" --out "$$(echo $$file | sed 's/....$$/json/')"; \
done

watch:
@inotifywait -m layouts -e close_write | while read -r _path _action file; do \
@inotifywait -m -r layouts -e close_write | while read -r path _action file; do \
case $$file in \
*yaml) kalamine build "layouts/$$file" --out "layouts/$$(basename "$${file%.*}").json";; \
*toml) kalamine build "layouts/$$file" --out "layouts/$$(basename "$${file%.*}").json";; \
*.yaml | *.toml) echo kalamine build "$$path$$file" --out "$$path$$(basename "$${file%.*}").json";; \
esac \
done

dev:
pip3 install kalamine
pipx install kalamine

clean:
rm -rf dist/*
Expand Down
13 changes: 9 additions & 4 deletions code/layout-analyzer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ window.addEventListener('DOMContentLoaded', () => {
let impreciseData = false;

const substituteChars = {
'\u00a0': ' ', // ( ) no-break space
'\u00a0': ' ', // ( ) no-break space
'\u202f': ' ', // ( ) narrow no-break space

'\u00ab': '"', // («) left-pointing double angle quotation mark
Expand Down Expand Up @@ -548,10 +548,15 @@ window.addEventListener('DOMContentLoaded', () => {
const setProp = (key, value) => {
if (key === 'layout') {
if (value) {
fetch(`../layouts/${value}.json`)
const layoutFolder = document
.querySelector(`#layout option[value="${value}"]`).dataset.folder;
fetch(`../layouts/${layoutFolder}/${value}.json`)
.then(response => response.json())
.then(data => {
inputField.placeholder = `zone de saisie ${value}`;
const selectedOption = document
.querySelector('#layout option:checked')
.textContent.trim() || value;
inputField.placeholder = `zone de saisie ${selectedOption}`;
keyboard.setKeyboardLayout(
data.keymap,
data.deadkeys,
Expand Down Expand Up @@ -596,7 +601,7 @@ window.addEventListener('DOMContentLoaded', () => {
IDs.map(prop => state[prop]).join('/').replace(/\/+$/, '');
};
const applyHashState = () => {
const hash = window.location.hash || '#/ergol//en+fr';
const hash = window.location.hash || '/ergol//en+fr';
const hashState = hash.split('/').slice(1);
IDs.forEach((key, i) => {
setProp(key, hashState[i] || '');
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
71 changes: 71 additions & 0 deletions layouts/fr.contrib/beopy-l.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"name": "Béopy 1DFH",
"description": "Béopy adapté avec la philosophie ergo‑l",
"geometry": "ergo",
"keymap": {
"Digit1": [ "1", "", "", "¹" ],
"Digit2": [ "2", "«", "", "²" ],
"Digit3": [ "3", "»", "", "³" ],
"Digit4": [ "4", "$", "", "" ],
"Digit5": [ "5", "%", "", "" ],
"Digit6": [ "6", "^", "", "" ],
"Digit7": [ "7", "&", "", "" ],
"Digit8": [ "8", "*", "", "" ],
"Digit9": [ "9", "#", "", "" ],
"Digit0": [ "0", "@", "", "" ],
"KeyQ": [ "b", "B", "@" ],
"KeyW": [ "**", "!", "<", "" ],
"KeyE": [ "o", "O", ">", "" ],
"KeyR": [ "p", "P", "$", "" ],
"KeyT": [ "y", "Y", "%", "" ],
"KeyY": [ "-", "?", "^", "*^" ],
"KeyU": [ "v", "V", "&" ],
"KeyI": [ "d", "D", "*", "×" ],
"KeyO": [ "l", "L", "'", "" ],
"KeyP": [ "j", "J", "`", "*`" ],
"KeyA": [ "a", "A", "{", "" ],
"KeyS": [ "u", "U", "(", "" ],
"KeyD": [ "e", "E", ")", "" ],
"KeyF": [ "i", "I", "}" ],
"KeyG": [ ",", ";", "=", "" ],
"KeyH": [ "c", "C", "~", "*~" ],
"KeyJ": [ "t", "T", "+", "±" ],
"KeyK": [ "s", "S", "-", "" ],
"KeyL": [ "r", "R", "_", "" ],
"Semicolon": [ "n", "N", "\"", "" ],
"KeyZ": [ "k", "K", "\\", "*/" ],
"KeyX": [ "z", "Z", "[" ],
"KeyC": [ "x", "X", "]" ],
"KeyV": [ ".", ":", "/", "÷" ],
"KeyB": [ "w", "W", "#" ],
"KeyN": [ "m", "M", "|", "¦" ],
"KeyM": [ "g", "G", "!", "¬" ],
"Comma": [ "q", "Q", ";", "" ],
"Period": [ "h", "H", ":" ],
"Slash": [ "f", "F", "?" ],
"Minus": [ "=", "" ],
"Equal": [ "/", "÷" ],
"BracketLeft": [ "+", "±" ],
"BracketRight": [ "*", "×" ],
"Quote": [ "'", "\"" ],
"Backquote": [ "^", "|" ],
"Backslash": [ "`", "~" ],
"IntlBackslash": [ "<", ">" ],
"Space": [ " ", "", " ", " " ]
},
"deadkeys": {
"**": { "**": "", "€": "", "1": "", "«": "", "2": "", "»": "", "3": "", "4": "¢", "5": "", "6": "¥", "7": "¤", "8": "§", "9": "", "0": "°", "B": "", "b": "", "!": "¡", "O": "_", "o": "_", "P": "Ê", "p": "ê", "y": "", "?": "¿", "-": "", "v": "#", "D": "Œ", "d": "œ", "L": "Ô", "l": "ô", "J": "Î", "j": "î", "A": "Æ", "a": "æ", "E": "É", "e": "é", "I": "È", "i": "è", ";": "", ",": "·", "C": "Ç", "c": "ç", "T": "À", "t": "à", "s": "(", "r": ")", "N": "Ñ", "n": "ñ", ":": "", ".": "", "w": "", "g": "&", "Q": "Â", "q": "â", "H": "Ù", "h": "ù", "F": "Û", "f": "û", " ": "", " ": "", " ": "" },
"*`": { "*`": "`", "A": "À", "a": "à", "E": "È", "e": "è", "I": "Ì", "i": "ì", "N": "Ǹ", "n": "ǹ", "O": "Ò", "o": "ò", "U": "Ù", "u": "ù", "W": "", "w": "", "Y": "", "y": "", " ": "`", " ": "`", " ": "`" },
"*´": { "*´": "´", "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": "ź", " ": "'", " ": "'", " ": "'" },
"*^": { "*^": "^", "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": "", "(": "", ")": "", "+": "", "-": "", "=": "", " ": "^", " ": "^", " ": "^" },
"*ˇ": { "*ˇ": "ˇ", "A": "Ǎ", "a": "ǎ", "C": "Č", "c": "č", "D": "Ď", "d": "ď", "E": "Ě", "e": "ě", "G": "Ǧ", "g": "ǧ", "H": "Ȟ", "h": "ȟ", "I": "Ǐ", "i": "ǐ", "K": "Ǩ", "k": "ǩ", "L": "Ľ", "l": "ľ", "N": "Ň", "n": "ň", "O": "Ǒ", "o": "ǒ", "R": "Ř", "r": "ř", "S": "Š", "s": "š", "T": "Ť", "t": "ť", "U": "Ǔ", "u": "ǔ", "Z": "Ž", "z": "ž", "0": "", "1": "", "2": "", "3": "", "4": "", "5": "", "6": "", "7": "", "8": "", "9": "", "(": "", ")": "", "+": "", "-": "", "=": "", " ": "ˇ", " ": "ˇ", " ": "ˇ" },
"*~": { "*~": "~", "A": "Ã", "a": "ã", "E": "", "e": "", "I": "Ĩ", "i": "ĩ", "N": "Ñ", "n": "ñ", "O": "Õ", "o": "õ", "U": "Ũ", "u": "ũ", "V": "", "v": "", "Y": "", "y": "", "<": "", ">": "", "=": "", " ": "~", " ": "~", " ": "~" },
"*¯": { "*¯": "ˉ", "A": "Ā", "a": "ā", "E": "Ē", "e": "ē", "G": "", "g": "", "I": "Ī", "i": "ī", "O": "Ō", "o": "ō", "U": "Ū", "u": "ū", "Y": "Ȳ", "y": "ȳ", " ": "¯", " ": "¯", " ": "¯" },
"*¨": { "*¨": "¨", "A": "Ä", "a": "ä", "E": "Ë", "e": "ë", "H": "", "h": "", "I": "Ï", "i": "ï", "O": "Ö", "o": "ö", "t": "", "U": "Ü", "u": "ü", "W": "", "w": "", "X": "", "x": "", "Y": "Ÿ", "y": "ÿ", " ": "\"", " ": "\"", " ": "\"" },
"*¸": { "*¸": "¸", "C": "Ç", "c": "ç", "D": "", "d": "", "E": "Ȩ", "e": "ȩ", "G": "Ģ", "g": "ģ", "H": "", "h": "", "K": "Ķ", "k": "ķ", "L": "Ļ", "l": "ļ", "N": "Ņ", "n": "ņ", "R": "Ŗ", "r": "ŗ", "S": "Ş", "s": "ş", "T": "Ţ", "t": "ţ", " ": "¸", " ": "¸", " ": "¸" },
"*/": { "*/": "/", "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": "ƶ", "<": "", "≤": "", "≥": "", ">": "", "=": "", " ": "/", " ": "/", " ": "/" },
"*µ": { "*µ": "µ", "A": "Α", "a": "α", "B": "Β", "b": "β", "D": "Δ", "d": "δ", "E": "Ε", "e": "ε", "F": "Φ", "f": "φ", "G": "Γ", "g": "γ", "H": "Η", "h": "η", "I": "Ι", "i": "ι", "J": "Θ", "j": "θ", "K": "Κ", "k": "κ", "L": "Λ", "l": "λ", "M": "Μ", "m": "μ", "N": "Ν", "n": "ν", "O": "Ο", "o": "ο", "P": "Π", "p": "π", "Q": "Χ", "q": "χ", "R": "Ρ", "r": "ρ", "S": "Σ", "s": "σ", "T": "Τ", "t": "τ", "U": "Υ", "u": "υ", "W": "Ω", "w": "ω", "X": "Ξ", "x": "ξ", "Y": "Ψ", "y": "ψ", "Z": "Ζ", "z": "ζ", " ": "µ", " ": "µ", " ": "µ" },
"*¤": { "*¤": "¤", "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": "¥", " ": "¤", " ": "¤", " ": "¤" }
},
"altgr": true
}
48 changes: 48 additions & 0 deletions layouts/fr.contrib/beopy-l.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name = "Béopy 1DFH"
name8 = "beopy1dk"
locale = "fr"
variant = "beopy1dk"
description = "Béopy adapté avec la philosophie ergo‑l"
author = "Malekpe"
url = "https://malekpe.net"
geometry = "ERGO"
version = "1.2.1"

base = '''
╭╌╌╌╌╌┰─────┬─────┬─────┬─────┬─────┰─────┬─────┬─────┬─────┬─────┰╌╌╌╌╌┬╌╌╌╌╌╮
┆ | ┃ € ‚ │ « ‘ │ » ’ │ $ │ % ┃ ^ │ & │ * │ # │ @ ┃ ≠ ┆ ÷ ┆
┆ ^ ┃ 1 „ │ 2 “ │ 3 ” │ 4 ¢ │ 5 ‰ ┃ 6 ¥ │ 7 ¤ │ 8 § │ 9 ¶ │ 0 ° ┃ = ┆ / ┆
╰╌╌╌╌╌╂─────┼─────┼─────┼─────┼─────╂─────┼─────┼─────┼─────┼─────╂╌╌╌╌╌┼╌╌╌╌╌┤
· ┃ B*µ │ ! ¡ │ O _ │ P │ Y ┃ ? ¿ │ V │ D │ L │ J ┃ ± ┆ × ┆
· ┃ *µ │***¨ │ _ │ ê │ – ┃ - ‑ │ # │ œ │ ô │ î ┃ + ┆ * ┆
· ┠─────┼─────┼─────┼─────┼─────╂─────┼─────┼─────┼─────┼─────╂╌╌╌╌╌┼╌╌╌╌╌┤
· ┃ A │ U │ E │ I │ ; • ┃ C │ T │ S │ R │ N ┃ " ┆ ~ ┆
· ┃ æ │ │ é │ è │ , · ┃ ç │ à │ ( │ ) │ ñ ┃ ' ┆ ` ┆
╭╌╌╌╌╌╂─────┼─────┼─────┼─────┼─────╂─────┼─────┼─────┼─────┼─────╂╌╌╌╌╌┴╌╌╌╌╌╯
┆ > ┃ K │ Z │ X │ : ⋯ │ W ┃ M │ G │ Q │ H │ F ┃ ·
┆ < ┃ │ │ │ . … │ — ┃ │ & │ â │ ù │ û ┃ ·
╰╌╌╌╌╌┸─────┴─────┴─────┴─────┴─────┸─────┴─────┴─────┴─────┴─────┚ · · · · · ·
'''

altgr = '''
╭╌╌╌╌╌┰─────┬─────┬─────┬─────┬─────┰─────┬─────┬─────┬─────┬─────┰╌╌╌╌╌┬╌╌╌╌╌╮
┆ ┃ ¹ │ ² │ ³ │ ⁴ │ ⁵ ┃ ⁶ │ ⁷ │ ⁸ │ ⁹ │ ⁰ ┃ ┆ ┆
┆ ┃ ₁ │ ₂ │ ₃ │ ₄ │ ₅ ┃ ₆ │ ₇ │ ₈ │ ₉ │ ₀ ┃ ┆ ┆
╰╌╌╌╌╌╂─────┼─────┼─────┼─────┼─────╂─────┼─────┼─────┼─────┼─────╂╌╌╌╌╌┼╌╌╌╌╌┤
· ┃ │ ≤ │ ≥ │ *¤ │ ‰ ┃ *^ │ │ × │ *´ │ *` ┃ ┆ ┆
· ┃ @ │ < │ > │ $ │ % ┃ ^ │ & │ * │ ' │ ` ┃ ┆ ┆
· ┠─────┼─────┼─────┼─────┼─────╂─────┼─────┼─────┼─────┼─────╂╌╌╌╌╌┼╌╌╌╌╌┤
· ┃ *ˇ │ ⁽ │ ⁾ │ │ ≠ ┃ *~ │ ± │ *¯ │ – │ *¨ ┃ ┆ ┆
· ┃ { │ ( │ ) │ } │ = ┃ ~ │ + │ - │ _ │ " ┃ ┆ ┆
╭╌╌╌╌╌╂─────┼─────┼─────┼─────┼─────╂─────┼─────┼─────┼─────┼─────╂╌╌╌╌╌┴╌╌╌╌╌╯
┆ ┃ */ │ │ │ ÷ │ ┃ ¦ │ ¬ │ *¸ │ │ ┃ ·
┆ ┃ \ │ [ │ ] │ / │ # ┃ | │ ! │ ; │ : │ ? ┃ ·
╰╌╌╌╌╌┸─────┴─────┴─────┴─────┴─────┸─────┴─────┴─────┴─────┴─────┚ · · · · · ·
'''

[spacebar]
shift = "\u202f" # NARROW NO-BREAK SPACE
altgr = "\u0020" # SPACE
altgr_shift = "\u00a0" # NO-BREAK SPACE
1dk = "\u2019" # RIGHT SINGLE QUOTATION MARK
1dk_shift = "\u2019" # RIGHT SINGLE QUOTATION MARK
60 changes: 60 additions & 0 deletions layouts/fr.contrib/beopy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"name": "Béopy",
"description": "French (Béopy)",
"geometry": "ergo",
"keymap": {
"Digit1": [ "\"", "1", "", "" ],
"Digit2": [ "«", "2", "<", "" ],
"Digit3": [ "»", "3", ">", "" ],
"Digit4": [ "(", "4", "[", "" ],
"Digit5": [ ")", "5", "]", "" ],
"Digit6": [ "@", "6", "_", "^" ],
"Digit7": [ "+", "7", "±", "¬" ],
"Digit8": [ "-", "8", "", "¼" ],
"Digit9": [ "/", "9", "÷", "½" ],
"Digit0": [ "*", "0", "×", "¾" ],
"KeyQ": [ "b", "B", "|", "¦" ],
"KeyW": [ "é", "É", "ó", "ő" ],
"KeyE": [ "o", "O", "œ", "Œ" ],
"KeyR": [ "p", "P", "{", "§" ],
"KeyT": [ "y", "Y", "}" ],
"KeyY": [ "!", "!", "¡" ],
"KeyU": [ "v", "V", "ǒ", "Ǒ" ],
"KeyI": [ "d", "D", "ð", "Ð" ],
"KeyO": [ "l", "L", "£", "ø" ],
"KeyP": [ "j", "J", "ij", "IJ" ],
"KeyA": [ "a", "A", "æ", "Æ" ],
"KeyS": [ "u", "U", "ù", "Ù" ],
"KeyD": [ "e", "E", "", "¤" ],
"KeyF": [ "i", "I", "ö", "ȯ" ],
"KeyG": [ ",", ";", "'", "ơ" ],
"KeyH": [ "c", "C", "©", "ſ" ],
"KeyJ": [ "t", "T", "þ", "Þ" ],
"KeyK": [ "s", "S", "ß", "" ],
"KeyL": [ "r", "R", "®", "" ],
"Semicolon": [ "n", "N", "õ", "Õ" ],
"KeyZ": [ "à", "À", "\\" ],
"KeyX": [ "è", "È", "ò", "*," ],
"KeyC": [ "x", "X", "&" ],
"KeyV": [ ".", ":", "", "·" ],
"KeyB": [ "w", "W", "ŏ", "" ],
"KeyN": [ "", "?", "¿", "" ],
"KeyM": [ "g", "G", "µ" ],
"Comma": [ "q", "Q", "å", "̣" ],
"Period": [ "h", "H", "", "" ],
"Slash": [ "f", "F", "ǫ", "Ǫ" ],
"Minus": [ "=", "°", "", "" ],
"Equal": [ "%", "`", "", "" ],
"BracketLeft": [ "k", "K", "~" ],
"BracketRight": [ "z", "Z", "ə", "Ə" ],
"Quote": [ "m", "M", "ō", "º" ],
"Backquote": [ "$", "#", "", "" ],
"Backslash": [ "ç", "Ç", "ţ", "ț" ],
"IntlBackslash": [ "ê", "Ê", "/" ],
"Space": [ " ", "", "_", " " ]
},
"deadkeys": {
"*,": { "*,": ",", "S": "Ș", "s": "ș", "T": "Ț", "t": "ț", " ": ",", " ": ",", " ": "," }
},
"altgr": true
}
Loading

0 comments on commit e078a83

Please sign in to comment.