diff options
| author | Jules Aguillon | 2022-04-24 00:34:26 +0200 |
|---|---|---|
| committer | Jules Aguillon | 2022-04-24 00:41:49 +0200 |
| commit | fec3f109c970901db31e1354b2cd3fc0015964e8 (patch) | |
| tree | ff22978e363e3646319ec2a0c0178768e3913451 | |
| parent | f9f44fbd7d96b4883114b8eb08f660d6912e3df0 (diff) | |
| download | unexpected-keyboard-fec3f109c970901db31e1354b2cd3fc0015964e8.tar.gz unexpected-keyboard-fec3f109c970901db31e1354b2cd3fc0015964e8.zip | |
Add support for Lithuanian
Requires two new diacritics: ogonek and dot_above.
The new accents are also added to the Latvian layout as the two language
can be close but not to the other localized layouts. A new mechanism is
needed to reproducibly add extra keys to layouts without manual
placement.
| -rw-r--r-- | res/xml/dvorak.xml | 4 | ||||
| -rw-r--r-- | res/xml/method.xml | 1 | ||||
| -rw-r--r-- | res/xml/qwerty.xml | 4 | ||||
| -rw-r--r-- | res/xml/qwerty_lv.xml | 4 | ||||
| -rw-r--r-- | srcs/juloo.keyboard2/KeyModifier.java | 4 | ||||
| -rw-r--r-- | srcs/juloo.keyboard2/KeyValue.java | 6 | ||||
| -rw-r--r-- | srcs/special_font/59.svg | 13 | ||||
| -rw-r--r-- | srcs/special_font/5A.svg | 13 |
8 files changed, 42 insertions, 7 deletions
diff --git a/res/xml/dvorak.xml b/res/xml/dvorak.xml index 24d2117..567af47 100644 --- a/res/xml/dvorak.xml +++ b/res/xml/dvorak.xml @@ -13,8 +13,8 @@ </row> <row> <key key0="a" key2="1" key4="!"/> - <key key0="o" key1="accent_macron" key2="2" key3="\@"/> - <key key0="e" key1="accent_caron" key2="3" key3="\#"/> + <key key0="o" key1="accent_macron" key2="2" key3="\@" key4="accent_ogonek"/> + <key key0="e" key1="accent_caron" key2="3" key3="\#" key4="accent_dot_above"/> <key key0="u" key2="4" key3="$"/> <key key0="i" key2="5" key3="%"/> <key key0="d" key2="6" key3="^"/> diff --git a/res/xml/method.xml b/res/xml/method.xml index 49b683d..85685d5 100644 --- a/res/xml/method.xml +++ b/res/xml/method.xml @@ -8,6 +8,7 @@ <subtype android:label="%s" android:languageTag="fr" android:imeSubtypeLocale="fr_FR" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=azerty,extra_keys=accent_grave|accent_aigu|accent_circonflexe|accent_cedille|accent_trema|€"/> <subtype android:label="%s" android:languageTag="it" android:imeSubtypeLocale="it_IT" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty,extra_keys=accent_grave|accent_aigu|€"/> <subtype android:label="%s" android:languageTag="ko" android:imeSubtypeLocale="ko_KR" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty_ko"/> + <subtype android:label="%s" android:languageTag="lt" android:imeSubtypeLocale="lt_LT" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty,extra_keys=accent_ogonek|accent_caron|accent_dot_above|accent_macron|€"/> <subtype android:label="%s" android:languageTag="lv" android:imeSubtypeLocale="lv_LV" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty_lv,extra_keys=accent_caron|accent_cedille|accent_macron|€"/> <subtype android:label="%s" android:languageTag="pt" android:imeSubtypeLocale="pt_BR" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty_pt,extra_keys=accent_aigu|accent_cedille|accent_circonflexe|accent_grave|accent_tilde|€"/> <subtype android:label="%s" android:languageTag="ru" android:imeSubtypeLocale="ru_RU" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=ru_jcuken"/> diff --git a/res/xml/qwerty.xml b/res/xml/qwerty.xml index 8f07441..5e314a8 100644 --- a/res/xml/qwerty.xml +++ b/res/xml/qwerty.xml @@ -14,9 +14,9 @@ </row> <row> <key shift="0.5" key0="a" key1="tab" key2="`"/> - <key key0="s" key1="accent_ring" key3="ß"/> + <key key0="s" key1="accent_ring" key3="ß" key4="accent_ogonek"/> <key key0="d" key1="accent_grave" key2="£" key3="accent_aigu"/> - <key key0="f"/> + <key key0="f" key1="accent_dot_above"/> <key key0="g" key1="accent_caron" key2="-" key3="_"/> <key key0="h" key2="=" key3="+"/> <key key0="j" key1="accent_trema" key2="accent_circonflexe" key4="}" key3="{"/> diff --git a/res/xml/qwerty_lv.xml b/res/xml/qwerty_lv.xml index 797aca2..e9a1fc2 100644 --- a/res/xml/qwerty_lv.xml +++ b/res/xml/qwerty_lv.xml @@ -14,9 +14,9 @@ </row> <row> <key shift="0.5" key0="a" key1="ā" key2="tab"/> - <key key0="s" key1="š" key3="ß"/> + <key key0="s" key1="š" key3="ß" key4="accent_ogonek"/> <key key0="d" key2="£"/> - <key key0="f"/> + <key key0="f" key1="accent_dot_above"/> <key key0="g" key1="ģ"/> <key key0="h" key2="accent_macron" key3="accent_caron" key4="accent_cedille"/> <key key0="j" key1="+" key2="=" key3="-" key4="_"/> diff --git a/srcs/juloo.keyboard2/KeyModifier.java b/srcs/juloo.keyboard2/KeyModifier.java index 39fc5a7..73ec84e 100644 --- a/srcs/juloo.keyboard2/KeyModifier.java +++ b/srcs/juloo.keyboard2/KeyModifier.java @@ -76,6 +76,10 @@ class KeyModifier return (char)KeyCharacterMap.getDeadChar('\u02DA', c); case KeyValue.FLAG_ACCENT_MACRON: return (char)KeyCharacterMap.getDeadChar('\u00AF', c); + case KeyValue.FLAG_ACCENT_OGONEK: + return (char)KeyCharacterMap.getDeadChar('\u02DB', c); + case KeyValue.FLAG_ACCENT_DOT_ABOVE: + return (char)KeyCharacterMap.getDeadChar('\u02D9', c); case KeyValue.FLAG_ACCENT_ORDINAL: switch (c) { diff --git a/srcs/juloo.keyboard2/KeyValue.java b/srcs/juloo.keyboard2/KeyValue.java index 3c7c305..12735ff 100644 --- a/srcs/juloo.keyboard2/KeyValue.java +++ b/srcs/juloo.keyboard2/KeyValue.java @@ -39,6 +39,7 @@ class KeyValue public static final int FLAG_META = (1 << 14); // Accent flags + public static final int FLAG_ACCENT_DOT_ABOVE = (1 << 15); public static final int FLAG_ACCENT1 = (1 << 16); // Grave public static final int FLAG_ACCENT2 = (1 << 17); // Aigu public static final int FLAG_ACCENT3 = (1 << 18); // Circonflexe @@ -53,12 +54,13 @@ class KeyValue public static final int FLAG_ACCENT_ORDINAL = (1 << 28); public static final int FLAG_ACCENT_ARROWS = (1 << 29); public static final int FLAG_ACCENT_BOX = (1 << 30); + public static final int FLAG_ACCENT_OGONEK = (1 << 31); public static final int FLAGS_ACCENTS = FLAG_ACCENT1 | FLAG_ACCENT2 | FLAG_ACCENT3 | FLAG_ACCENT4 | FLAG_ACCENT5 | FLAG_ACCENT6 | FLAG_ACCENT_CARON | FLAG_ACCENT_MACRON | FLAG_ACCENT_SUPERSCRIPT | FLAG_ACCENT_SUBSCRIPT | FLAG_ACCENT_ORDINAL | FLAG_ACCENT_ARROWS | - FLAG_ACCENT_BOX | FLAG_ACCENT_RING; + FLAG_ACCENT_BOX | FLAG_ACCENT_RING | FLAG_ACCENT_OGONEK | FLAG_ACCENT_DOT_ABOVE; // Language specific keys that are removed from the keyboard by default public static final int FLAG_LOCALIZED = (1 << 25); @@ -169,6 +171,8 @@ class KeyValue addModifierKey("accent_ring", "\u0056", FLAG_ACCENT_RING | FLAG_KEY_FONT | FLAG_LOCALIZED); addModifierKey("accent_tilde", "\u0057", FLAG_ACCENT4 | FLAG_KEY_FONT | FLAG_LOCALIZED); addModifierKey("accent_trema", "\u0058", FLAG_ACCENT6 | FLAG_KEY_FONT | FLAG_LOCALIZED); + addModifierKey("accent_ogonek", "\u0059", FLAG_ACCENT_OGONEK | FLAG_KEY_FONT | FLAG_LOCALIZED); + addModifierKey("accent_dot_above", "\u005a", FLAG_ACCENT_DOT_ABOVE | FLAG_KEY_FONT | FLAG_LOCALIZED); addModifierKey("superscript", "Sup", FLAG_ACCENT_SUPERSCRIPT | FLAG_SMALLER_FONT); addModifierKey("subscript", "Sub", FLAG_ACCENT_SUBSCRIPT | FLAG_SMALLER_FONT); addModifierKey("ordinal", "Ord", FLAG_ACCENT_ORDINAL | FLAG_SMALLER_FONT); diff --git a/srcs/special_font/59.svg b/srcs/special_font/59.svg new file mode 100644 index 0000000..3a45f06 --- /dev/null +++ b/srcs/special_font/59.svg @@ -0,0 +1,13 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="-20 0 1168 2048"> + <g transform="matrix(1 0 0 -1 0 1536)"> + <path fill="currentColor" +d="M931.256 1002.78l-69.3145 -69.3145q-112.472 86.3154 -249.792 98.0859v99.3945q176.555 -11.7715 319.106 -128.166v0zM516.679 1031.55q-133.396 -10.4619 -249.792 -100.701q0 1.30859 -71.9297 74.5449l2.61523 -2.61523q142.554 116.396 319.106 128.166v-99.3945 +v0zM197.572 860.229q-90.2393 -103.316 -107.24 -245.867h-99.3936q17.001 181.786 137.32 319.104l-6.53906 5.23145l3.92285 -2.61523l41.8506 -43.1582q30.0791 -31.3867 30.0791 -32.6953v0zM1137.89 614.361h-99.3936q-17.001 141.242 -107.239 248.483 +l69.3135 70.6211q120.318 -137.319 137.319 -319.104v0zM1137.89 517.583q-14.3857 -189.633 -129.474 -326.953l-69.3135 70.6221q86.3154 111.164 99.3936 256.331h99.3936v0zM189.726 263.867h0.000976562q-86.3154 107.239 -99.3936 253.716h-99.3945 +q13.0781 -189.633 128.165 -326.953l-3.92285 -3.92383q-1.30762 0 74.5449 77.1611zM939.103 121.315q-146.476 -124.242 -326.952 -136.014v99.3945q139.935 11.7705 257.639 105.934zM516.679 -14.6973q-180.478 11.7715 -326.953 136.013l69.3145 69.3145 +q117.703 -90.2383 257.64 -105.933v-99.3945h-0.000976562zM987 0q-70 -52 -109.5 -99.5t-39.5 -101.5q0 -42 22.5 -66t73.5 -24q27 0 50 7.5t49 18.5l33 -123q-36 -19 -79.5 -31.5t-103.5 -12.5q-95 0 -155.5 55t-60.5 154q0 80 60.5 152t187.5 128z" /> + </g> + +</svg> diff --git a/srcs/special_font/5A.svg b/srcs/special_font/5A.svg new file mode 100644 index 0000000..650e075 --- /dev/null +++ b/srcs/special_font/5A.svg @@ -0,0 +1,13 @@ +<?xml version="1.0" standalone="no"?> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" viewBox="-20 0 1168 2048"> + <g transform="matrix(1 0 0 -1 0 1536)"> + <path fill="currentColor" +d="M931.256 1002.78l-69.3145 -69.3145q-112.472 86.3154 -249.792 98.0859v99.3945q176.555 -11.7715 319.106 -128.166v0zM516.679 1031.55q-133.396 -10.4619 -249.792 -100.701q0 1.30859 -71.9297 74.5449l2.61523 -2.61523q142.554 116.396 319.106 128.166v-99.3945 +v0zM197.572 860.229q-90.2393 -103.316 -107.24 -245.867h-99.3936q17.001 181.786 137.32 319.104l-6.53906 5.23145l3.92285 -2.61523l41.8506 -43.1582q30.0791 -31.3867 30.0791 -32.6953v0zM1137.89 614.361h-99.3936q-17.001 141.242 -107.239 248.483 +l69.3135 70.6211q120.318 -137.319 137.319 -319.104v0zM1137.89 517.583q-14.3857 -189.633 -129.474 -326.953l-69.3135 70.6221q86.3154 111.164 99.3936 256.331h99.3936v0zM189.726 263.867h0.000976562q-86.3154 107.239 -99.3936 253.716h-99.3945 +q13.0781 -189.633 128.165 -326.953l-3.92285 -3.92383q-1.30762 0 74.5449 77.1611zM939.103 121.315q-146.476 -124.242 -326.952 -136.014v99.3945q139.935 11.7705 257.639 105.934zM516.679 -14.6973q-180.478 11.7715 -326.953 136.013l69.3145 69.3145 +q117.703 -90.2383 257.64 -105.933v-99.3945h-0.000976562zM648 1283h-218v201h218v-201z" /> + </g> + +</svg> |
