mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2024-12-28 17:08:48 +01:00
Localize € and £
Show these characters only for users that have the corresponding locale installed (a supported eu language for €, en-GB for £). Add these characters to most layouts.
This commit is contained in:
parent
d73be58c1a
commit
632a9ac590
@ -4,11 +4,11 @@
|
|||||||
<key key0="shift" width="1.5" key1="esc" key2="tab"/>
|
<key key0="shift" width="1.5" key1="esc" key2="tab"/>
|
||||||
<key key0="p" key1="accent_ring" key2="." key3="<"/>
|
<key key0="p" key1="accent_ring" key2="." key3="<"/>
|
||||||
<key key0="y" key1="accent_grave" key2="," key3=">"/>
|
<key key0="y" key1="accent_grave" key2="," key3=">"/>
|
||||||
<key key0="f"/>
|
<key key0="f" key4="€"/>
|
||||||
<key key0="g" key2="\\" key3="|"/>
|
<key key0="g" key2="\\" key3="|"/>
|
||||||
<key key0="c" key1="accent_trema" key2="accent_circonflexe" key3="{" key4="}"/>
|
<key key0="c" key1="accent_trema" key2="accent_circonflexe" key3="{" key4="}"/>
|
||||||
<key key0="r" key3="[" key4="]"/>
|
<key key0="r" key3="[" key4="]"/>
|
||||||
<key key0="l" key2="=" key3="+"/>
|
<key key0="l" key2="=" key3="+" key4="£"/>
|
||||||
<key key0="backspace" key2="delete" width="1.5"/>
|
<key key0="backspace" key2="delete" width="1.5"/>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<key shift="0.5" key0="а" key1="tab" key2="`"/>
|
<key shift="0.5" key0="а" key1="tab" key2="`"/>
|
||||||
<key key0="с"/>
|
<key key0="с" key2="£"/>
|
||||||
<key key0="д" key1="accent_grave" key3="accent_aigu"/>
|
<key key0="д" key1="accent_grave" key3="accent_aigu"/>
|
||||||
<key key0="ф"/>
|
<key key0="ф"/>
|
||||||
<key key0="г" key1="accent_caron" key2="-" key3="_"/>
|
<key key0="г" key1="accent_caron" key2="-" key3="_"/>
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<input-method xmlns:android="http://schemas.android.com/apk/res/android" android:settingsActivity="juloo.keyboard2.SettingsActivity" android:supportsSwitchingToNextInputMethod="true">
|
<input-method xmlns:android="http://schemas.android.com/apk/res/android" android:settingsActivity="juloo.keyboard2.SettingsActivity" android:supportsSwitchingToNextInputMethod="true">
|
||||||
<subtype android:label="%s" android:languageTag="de" android:imeSubtypeLocale="de_DE" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwertz,extra_keys=trema|szlig"/>
|
<subtype android:label="%s" android:languageTag="bg" android:imeSubtypeLocale="bg_BG" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=bgph1|euro"/>
|
||||||
<subtype android:label="%s" android:languageTag="en" android:imeSubtypeLocale="en_US" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty"/>
|
<subtype android:label="%s" android:languageTag="de" android:imeSubtypeLocale="de_DE" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwertz,extra_keys=trema|szlig|euro"/>
|
||||||
<subtype android:label="%s" android:languageTag="es" android:imeSubtypeLocale="es_ES" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty,extra_keys=aigu|tilde|trema"/>
|
<subtype android:label="%s" android:languageTag="en-GB" android:imeSubtypeLocale="en_GB" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty,extra_keys=pound|euro"/>
|
||||||
<subtype android:label="%s" android:languageTag="fr" android:imeSubtypeLocale="fr_FR" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=azerty,extra_keys=grave|aigu|circonflexe|cedille|trema"/>
|
<subtype android:label="%s" android:languageTag="en-US" android:imeSubtypeLocale="en_US" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty"/>
|
||||||
<subtype android:label="%s" android:languageTag="it" android:imeSubtypeLocale="it_IT" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty,extra_keys=grave|aigu"/>
|
<subtype android:label="%s" android:languageTag="es" android:imeSubtypeLocale="es_ES" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty,extra_keys=aigu|tilde|trema|euro"/>
|
||||||
<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=caron|cedille|macron"/>
|
<subtype android:label="%s" android:languageTag="fr" android:imeSubtypeLocale="fr_FR" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=azerty,extra_keys=grave|aigu|circonflexe|cedille|trema|euro"/>
|
||||||
|
<subtype android:label="%s" android:languageTag="it" android:imeSubtypeLocale="it_IT" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty,extra_keys=grave|aigu|euro"/>
|
||||||
|
<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=caron|cedille|macron|euro"/>
|
||||||
|
<subtype android:label="%s" android:languageTag="pt" android:imeSubtypeLocale="pt_BR" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty,extra_keys=aigu|cedille|circonflexe|grave|tilde|euro"/>
|
||||||
<subtype android:label="%s" android:languageTag="ru" android:imeSubtypeLocale="ru_RU" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=ru_jcuken"/>
|
<subtype android:label="%s" android:languageTag="ru" android:imeSubtypeLocale="ru_RU" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=ru_jcuken"/>
|
||||||
<subtype android:label="%s" android:languageTag="pt" android:imeSubtypeLocale="pt_BR" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty,extra_keys=aigu|cedille|circonflexe|grave|tilde"/>
|
<subtype android:label="%s" android:languageTag="sv" android:imeSubtypeLocale="sv_SE" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty,extra_keys=aigu|trema|ring|euro"/>
|
||||||
<subtype android:label="%s" android:languageTag="sv" android:imeSubtypeLocale="sv_SE" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=qwerty,extra_keys=aigu|trema|ring"/>
|
|
||||||
<subtype android:label="%s" android:languageTag="bg" android:imeSubtypeLocale="bg_BG" android:imeSubtypeMode="keyboard" android:isAsciiCapable="true" android:imeSubtypeExtraValue="default_layout=bgph1"/>
|
|
||||||
</input-method>
|
</input-method>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<row>
|
<row>
|
||||||
<key key0="q" key1="esc" key2="1" key3="~" key4="!"/>
|
<key key0="q" key1="esc" key2="1" key3="~" key4="!"/>
|
||||||
<key key0="w" key2="2" key3="\@"/>
|
<key key0="w" key2="2" key3="\@"/>
|
||||||
<key key0="e" key2="3" key3="\#"/>
|
<key key0="e" key2="3" key3="\#" key4="€"/>
|
||||||
<key key0="r" key2="4" key3="$"/>
|
<key key0="r" key2="4" key3="$"/>
|
||||||
<key key0="t" key2="5" key3="%"/>
|
<key key0="t" key2="5" key3="%"/>
|
||||||
<key key0="y" key2="6" key3="^"/>
|
<key key0="y" key2="6" key3="^"/>
|
||||||
@ -15,7 +15,7 @@
|
|||||||
<row>
|
<row>
|
||||||
<key shift="0.5" key0="a" key1="tab" key2="`"/>
|
<key shift="0.5" key0="a" key1="tab" key2="`"/>
|
||||||
<key key0="s" key1="accent_ring" key3="ß"/>
|
<key key0="s" key1="accent_ring" key3="ß"/>
|
||||||
<key key0="d" key1="accent_grave" key3="accent_aigu"/>
|
<key key0="d" key1="accent_grave" key2="£" key3="accent_aigu"/>
|
||||||
<key key0="f"/>
|
<key key0="f"/>
|
||||||
<key key0="g" key1="accent_caron" key2="-" key3="_"/>
|
<key key0="g" key1="accent_caron" key2="-" key3="_"/>
|
||||||
<key key0="h" key2="=" key3="+"/>
|
<key key0="h" key2="=" key3="+"/>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<row>
|
<row>
|
||||||
<key key0="q" key1="esc" key2="1" key3="~" key4="!"/>
|
<key key0="q" key1="esc" key2="1" key3="~" key4="!"/>
|
||||||
<key key0="w" key2="2" key3="\@"/>
|
<key key0="w" key2="2" key3="\@"/>
|
||||||
<key key0="e" key1="ē" key2="3" key3="\#" />
|
<key key0="e" key1="ē" key2="3" key3="\#" key4="€"/>
|
||||||
<key key0="r" key1="ŗ" key2="4" key3="$"/>
|
<key key0="r" key1="ŗ" key2="4" key3="$"/>
|
||||||
<key key0="t" key2="5" key3="%"/>
|
<key key0="t" key2="5" key3="%"/>
|
||||||
<key key0="y" key2="6" key3="^"/>
|
<key key0="y" key2="6" key3="^"/>
|
||||||
@ -14,8 +14,8 @@
|
|||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<key shift="0.5" key0="a" key1="ā"/>
|
<key shift="0.5" key0="a" key1="ā"/>
|
||||||
<key key0="s" key1="š" />
|
<key key0="s" key1="š" key3="ß"/>
|
||||||
<key key0="d" />
|
<key key0="d" key2="£"/>
|
||||||
<key key0="f"/>
|
<key key0="f"/>
|
||||||
<key key0="g" key1="ģ"/>
|
<key key0="g" key1="ģ"/>
|
||||||
<key key0="h" key2="accent_macron" key3="accent_caron" key4="accent_cedille"/>
|
<key key0="h" key2="accent_macron" key3="accent_caron" key4="accent_cedille"/>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
<row>
|
<row>
|
||||||
<key shift="0.5" key0="a" key1="tab" key2="`" key3="ä"/>
|
<key shift="0.5" key0="a" key1="tab" key2="`" key3="ä"/>
|
||||||
<key key0="s" key3="ß"/>
|
<key key0="s" key3="ß"/>
|
||||||
<key key0="d"/>
|
<key key0="d" key2="£"/>
|
||||||
<key key0="f" key1="~"/>
|
<key key0="f" key1="~"/>
|
||||||
<key key0="g" key3="-"/>
|
<key key0="g" key3="-"/>
|
||||||
<key key0="h" key3="+"/>
|
<key key0="h" key3="+"/>
|
||||||
|
@ -173,6 +173,8 @@ final class Config
|
|||||||
case "macron": return KeyValue.FLAG_ACCENT_MACRON;
|
case "macron": return KeyValue.FLAG_ACCENT_MACRON;
|
||||||
case "ring": return KeyValue.FLAG_ACCENT_RING;
|
case "ring": return KeyValue.FLAG_ACCENT_RING;
|
||||||
case "szlig": return KeyValue.FLAG_LANG_SZLIG;
|
case "szlig": return KeyValue.FLAG_LANG_SZLIG;
|
||||||
|
case "euro": return KeyValue.FLAG_LANG_EURO;
|
||||||
|
case "pound": return KeyValue.FLAG_LANG_POUND;
|
||||||
case "tilde": return KeyValue.FLAG_ACCENT4;
|
case "tilde": return KeyValue.FLAG_ACCENT4;
|
||||||
case "trema": return KeyValue.FLAG_ACCENT6;
|
case "trema": return KeyValue.FLAG_ACCENT6;
|
||||||
default: throw new RuntimeException(name);
|
default: throw new RuntimeException(name);
|
||||||
|
@ -56,8 +56,11 @@ class KeyValue
|
|||||||
|
|
||||||
// Language specific keys
|
// Language specific keys
|
||||||
public static final int FLAG_LANG_SZLIG = (1 << 25);
|
public static final int FLAG_LANG_SZLIG = (1 << 25);
|
||||||
|
public static final int FLAG_LANG_EURO = (1 << 29);
|
||||||
|
public static final int FLAG_LANG_POUND = (1 << 30);
|
||||||
|
|
||||||
public static final int FLAGS_LANGS = FLAG_LANG_SZLIG;
|
public static final int FLAGS_LANGS = FLAG_LANG_SZLIG | FLAG_LANG_EURO |
|
||||||
|
FLAG_LANG_POUND;
|
||||||
|
|
||||||
public static final int FLAGS_NOT_HIDDEN_ACCENTS = FLAG_ACCENT_SUPERSCRIPT |
|
public static final int FLAGS_NOT_HIDDEN_ACCENTS = FLAG_ACCENT_SUPERSCRIPT |
|
||||||
FLAG_ACCENT_SUBSCRIPT | FLAG_ACCENT_ORDINAL;
|
FLAG_ACCENT_SUBSCRIPT | FLAG_ACCENT_ORDINAL;
|
||||||
@ -148,10 +151,6 @@ class KeyValue
|
|||||||
|
|
||||||
static
|
static
|
||||||
{
|
{
|
||||||
String chars = "<>&\"_°~{|^}$*:!£%µ?.§€";
|
|
||||||
for (int i = 0; i < chars.length(); i++)
|
|
||||||
addCharKey(chars.charAt(i), EVENT_NONE);
|
|
||||||
|
|
||||||
addModifierKey("shift", "\uE808", FLAG_LOCK | FLAG_SHIFT | FLAG_KEY_FONT);
|
addModifierKey("shift", "\uE808", FLAG_LOCK | FLAG_SHIFT | FLAG_KEY_FONT);
|
||||||
addModifierKey("ctrl", "Ctrl", FLAG_CTRL);
|
addModifierKey("ctrl", "Ctrl", FLAG_CTRL);
|
||||||
addModifierKey("alt", "Alt", FLAG_ALT);
|
addModifierKey("alt", "Alt", FLAG_ALT);
|
||||||
@ -224,6 +223,8 @@ class KeyValue
|
|||||||
addCharKey('(', KeyEvent.KEYCODE_NUMPAD_LEFT_PAREN);
|
addCharKey('(', KeyEvent.KEYCODE_NUMPAD_LEFT_PAREN);
|
||||||
addCharKey(')', KeyEvent.KEYCODE_NUMPAD_RIGHT_PAREN);
|
addCharKey(')', KeyEvent.KEYCODE_NUMPAD_RIGHT_PAREN);
|
||||||
addCharKey('ß', EVENT_NONE, FLAG_LANG_SZLIG);
|
addCharKey('ß', EVENT_NONE, FLAG_LANG_SZLIG);
|
||||||
|
addCharKey('€', EVENT_NONE, FLAG_LANG_EURO);
|
||||||
|
addCharKey('£', EVENT_NONE, FLAG_LANG_POUND);
|
||||||
|
|
||||||
addSpecialKey("config", "⛭", EVENT_CONFIG);
|
addSpecialKey("config", "⛭", EVENT_CONFIG);
|
||||||
addSpecialKey("switch_text", "ABC", EVENT_SWITCH_TEXT);
|
addSpecialKey("switch_text", "ABC", EVENT_SWITCH_TEXT);
|
||||||
|
@ -64,6 +64,8 @@ public class Keyboard2 extends InputMethodService
|
|||||||
String s = subtype.getExtraValueOf("default_layout");
|
String s = subtype.getExtraValueOf("default_layout");
|
||||||
if (s != null)
|
if (s != null)
|
||||||
l = Config.layoutId_of_string(s);
|
l = Config.layoutId_of_string(s);
|
||||||
|
else
|
||||||
|
l = R.xml.qwerty;
|
||||||
}
|
}
|
||||||
_currentTextLayout = l;
|
_currentTextLayout = l;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user