Add Swedish

First add the 'ring' accent.
The swedish language uses the qwerty layout and three accents (aigu,
trema, ring)
This commit is contained in:
Jules Aguillon 2021-12-11 17:05:49 +01:00
parent 58e37b484c
commit 573c13fb82
6 changed files with 18 additions and 3 deletions

View File

@ -14,7 +14,7 @@
</row>
<row>
<key key0="q" key1="tab" />
<key key0="s" />
<key key0="s" key1="accent_ring" />
<key key0="d" key1="accent_grave" key3="accent_aigu" />
<key key0="f" key3="{" key4="}" />
<key key0="g" key3="[" key4="]" />

View File

@ -30,4 +30,11 @@
android:isAsciiCapable="true"
android:imeSubtypeExtraValue="default_layout=qwerty,accents=grave|aigu"
/>
<subtype android:label="@string/subtype_label"
android:languageTag="sv"
android:imeSubtypeLocale="sv_SE"
android:imeSubtypeMode="keyboard"
android:isAsciiCapable="true"
android:imeSubtypeExtraValue="default_layout=qwerty,accents=aigu|trema|ring"
/>
</input-method>

View File

@ -14,7 +14,7 @@
</row>
<row>
<key shift="0.5" key0="a" key1="tab" key2="`" />
<key key0="s" />
<key key0="s" key1="accent_ring" />
<key key0="d" key1="accent_grave" key3="accent_aigu" />
<key key0="f" />
<key key0="g" key2="-" key3="_" />

View File

@ -118,6 +118,7 @@ class Config
case "tilde": return KeyValue.FLAG_ACCENT4;
case "cedille": return KeyValue.FLAG_ACCENT5;
case "trema": return KeyValue.FLAG_ACCENT6;
case "ring": return KeyValue.FLAG_ACCENT_RING;
default: throw new RuntimeException(name);
}
}

View File

@ -102,6 +102,11 @@ class KeyModifier
case '-': return '÷';
default: return (char)KeyCharacterMap.getDeadChar('\u00A8', c);
}
case KeyValue.FLAG_ACCENT_RING:
switch (c)
{
default: return (char)KeyCharacterMap.getDeadChar('\u02DA', c);
}
case KeyValue.FLAG_ACCENT_SUPERSCRIPT:
switch (c)
{

View File

@ -41,10 +41,11 @@ class KeyValue
public static final int FLAG_ACCENT6 = (1 << 21); // Tréma
public static final int FLAG_ACCENT_SUPERSCRIPT = (1 << 22);
public static final int FLAG_ACCENT_SUBSCRIPT = (1 << 23);
public static final int FLAG_ACCENT_RING = (1 << 24);
public static final int FLAGS_ACCENTS = FLAG_ACCENT1 | FLAG_ACCENT2 |
FLAG_ACCENT3 | FLAG_ACCENT4 | FLAG_ACCENT5 | FLAG_ACCENT6 |
FLAG_ACCENT_SUPERSCRIPT | FLAG_ACCENT_SUBSCRIPT;
FLAG_ACCENT_SUPERSCRIPT | FLAG_ACCENT_SUBSCRIPT | FLAG_ACCENT_RING;
public final String name;
public final String symbol;
@ -131,6 +132,7 @@ class KeyValue
addModifierKey("accent_tilde", "◌̃", FLAG_ACCENT4);
addModifierKey("accent_cedille", "◌̧", FLAG_ACCENT5);
addModifierKey("accent_trema", "◌̈", FLAG_ACCENT6);
addModifierKey("accent_ring", "◌̊", FLAG_ACCENT_RING);
addModifierKey("superscript", "◌͆", FLAG_ACCENT_SUPERSCRIPT);
addModifierKey("subscript", "◌̺", FLAG_ACCENT_SUBSCRIPT);
addModifierKey("fn", "Fn", FLAG_FN);