From fec3f109c970901db31e1354b2cd3fc0015964e8 Mon Sep 17 00:00:00 2001 From: Jules Aguillon Date: Sun, 24 Apr 2022 00:34:26 +0200 Subject: [PATCH] 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. --- res/xml/dvorak.xml | 4 ++-- res/xml/method.xml | 1 + res/xml/qwerty.xml | 4 ++-- res/xml/qwerty_lv.xml | 4 ++-- srcs/juloo.keyboard2/KeyModifier.java | 4 ++++ srcs/juloo.keyboard2/KeyValue.java | 6 +++++- srcs/special_font/59.svg | 13 +++++++++++++ srcs/special_font/5A.svg | 13 +++++++++++++ 8 files changed, 42 insertions(+), 7 deletions(-) create mode 100644 srcs/special_font/59.svg create mode 100644 srcs/special_font/5A.svg 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 @@ - - + + 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 @@ + 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 @@ - + - + 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 @@ - + - + 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 @@ + + + + + + + + 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 @@ + + + + + + + +