mirror of
https://github.com/Julow/Unexpected-Keyboard.git
synced 2025-02-16 17:41:21 +01:00
Define the Fn modifier using the compose mechanism
This removes 100Kb from the app.
This commit is contained in:
parent
e734d1d0e2
commit
b600332595
182
srcs/compose/fn.json
Normal file
182
srcs/compose/fn.json
Normal file
@ -0,0 +1,182 @@
|
|||||||
|
{
|
||||||
|
"1": "f1",
|
||||||
|
"2": "f2",
|
||||||
|
"3": "f3",
|
||||||
|
"4": "f4",
|
||||||
|
"5": "f5",
|
||||||
|
"6": "f6",
|
||||||
|
"7": "f7",
|
||||||
|
"8": "f8",
|
||||||
|
"9": "f9",
|
||||||
|
"0": "f10",
|
||||||
|
"<": "«",
|
||||||
|
">": "»",
|
||||||
|
"{": "‹",
|
||||||
|
"}": "›",
|
||||||
|
"[": "‘",
|
||||||
|
"]": "’",
|
||||||
|
"(": "“",
|
||||||
|
")": "”",
|
||||||
|
"'": "‚",
|
||||||
|
"\"": "„",
|
||||||
|
"-": "–",
|
||||||
|
"_": "—",
|
||||||
|
"^": "¬",
|
||||||
|
"%": "‰",
|
||||||
|
"=": "≈",
|
||||||
|
"u": "µ",
|
||||||
|
"a": "æ",
|
||||||
|
"o": "œ",
|
||||||
|
"*": "°",
|
||||||
|
".": "…",
|
||||||
|
",": "·",
|
||||||
|
"!": "¡",
|
||||||
|
"?": "¿",
|
||||||
|
"|": "¦",
|
||||||
|
"§": "¶",
|
||||||
|
"†": "‡",
|
||||||
|
"×": "∙",
|
||||||
|
" ": "nbsp",
|
||||||
|
// arrows
|
||||||
|
"↖": "⇖",
|
||||||
|
"↑": "⇑",
|
||||||
|
"↗": "⇗",
|
||||||
|
"←": "⇐",
|
||||||
|
"→": "⇒",
|
||||||
|
"↙": "⇙",
|
||||||
|
"↓": "⇓",
|
||||||
|
"↘": "⇘",
|
||||||
|
"↔": "⇔",
|
||||||
|
"↕": "⇕",
|
||||||
|
// Currency symbols
|
||||||
|
"e": "€",
|
||||||
|
"l": "£",
|
||||||
|
"r": "₹",
|
||||||
|
"y": "¥",
|
||||||
|
"c": "¢",
|
||||||
|
"p": "₽",
|
||||||
|
"b": "₱",
|
||||||
|
"h": "₴",
|
||||||
|
"z": "₿",
|
||||||
|
// avoid showing these twice
|
||||||
|
"€": "removed",
|
||||||
|
"£": "removed",
|
||||||
|
// alternative greek letters
|
||||||
|
"π": "ϖ",
|
||||||
|
"θ": "ϑ",
|
||||||
|
"Θ": "ϴ",
|
||||||
|
"ε": "ϵ",
|
||||||
|
"β": "ϐ",
|
||||||
|
"ρ": "ϱ",
|
||||||
|
"σ": "ς",
|
||||||
|
"γ": "ɣ",
|
||||||
|
"φ": "ϕ",
|
||||||
|
"υ": "ϒ",
|
||||||
|
"κ": "ϰ",
|
||||||
|
// alternative math characters
|
||||||
|
"∪": "⋃",
|
||||||
|
"∩": "⋂",
|
||||||
|
"∃": "∄",
|
||||||
|
"∈": "∉",
|
||||||
|
"∫": "∮",
|
||||||
|
"Π": "∏",
|
||||||
|
"Σ": "∑",
|
||||||
|
"∨": "⋁",
|
||||||
|
"∧": "⋀",
|
||||||
|
"⊷": "⊶",
|
||||||
|
"⊂": "⊆",
|
||||||
|
"⊃": "⊇",
|
||||||
|
"±": "∓",
|
||||||
|
// hebrew niqqud
|
||||||
|
"ק": "qamats", // kamatz
|
||||||
|
"ר": "hataf_qamats", // reduced kamatz
|
||||||
|
"ו": "holam",
|
||||||
|
"ם": "rafe",
|
||||||
|
"פ": "patah", // patach
|
||||||
|
"ש": "sheva",
|
||||||
|
"ד": "dagesh", // or mapiq
|
||||||
|
"ח": "hiriq",
|
||||||
|
"ף": "hataf_patah", // reduced patach
|
||||||
|
"ז": "qubuts", // kubuts
|
||||||
|
"ס": "segol",
|
||||||
|
"ב": "hataf_segol", // reduced segol
|
||||||
|
"צ": "tsere",
|
||||||
|
// Devanagari symbols
|
||||||
|
"ए": "ऍ",
|
||||||
|
"े": "ॅ",
|
||||||
|
"ऐ": "ऎ",
|
||||||
|
"ै": "ॆ",
|
||||||
|
"ऋ": "ॠ",
|
||||||
|
"ृ": "ॄ",
|
||||||
|
"ळ": "ऴ",
|
||||||
|
"र": "ऱ",
|
||||||
|
"क": "क़",
|
||||||
|
"ख": "ख़",
|
||||||
|
"ग": "ग़",
|
||||||
|
"घ": "ॻ",
|
||||||
|
"ढ": "ढ़",
|
||||||
|
"न": "ऩ",
|
||||||
|
"ड": "ड़",
|
||||||
|
"ट": "ॸ",
|
||||||
|
"ण": "ॾ",
|
||||||
|
"फ": "फ़",
|
||||||
|
"ऌ": "ॡ",
|
||||||
|
"ॢ": "ॣ",
|
||||||
|
"औ": "ॵ",
|
||||||
|
"ौ": "ॏ",
|
||||||
|
"ओ": "ऒ",
|
||||||
|
"ो": "ॊ",
|
||||||
|
"च": "ॼ",
|
||||||
|
"ज": "ज़",
|
||||||
|
"ब": "ॿ",
|
||||||
|
"व": "ॺ",
|
||||||
|
"य": "य़",
|
||||||
|
"अ": "ॲ",
|
||||||
|
"आ": "ऑ",
|
||||||
|
"ा": "ॉ",
|
||||||
|
"झ": "ॹ",
|
||||||
|
"ई": "ॴ",
|
||||||
|
"ी": "ऻ",
|
||||||
|
"इ": "ॳ",
|
||||||
|
"ि": "ऺ",
|
||||||
|
"उ": "ॶ",
|
||||||
|
"ऊ": "ॷ",
|
||||||
|
"ु": "ऄ",
|
||||||
|
"ष": "क्ष",
|
||||||
|
"थ": "त्र",
|
||||||
|
"द": "द्र",
|
||||||
|
"प": "प्र",
|
||||||
|
"श": "श्र",
|
||||||
|
"छ": "श्च",
|
||||||
|
"ँ": "ऀ",
|
||||||
|
"₹": "₨",
|
||||||
|
"ॖ": "ॗ",
|
||||||
|
"॓": "॔",
|
||||||
|
"॰": "ॱ",
|
||||||
|
"।": "॥",
|
||||||
|
"ं": "ॕ",
|
||||||
|
"़": "ॎ",
|
||||||
|
"ऽ": "ॽ",
|
||||||
|
// Persian numbers
|
||||||
|
"۱": "f1",
|
||||||
|
"۲": "f2",
|
||||||
|
"۳": "f3",
|
||||||
|
"۴": "f4",
|
||||||
|
"۵": "f5",
|
||||||
|
"۶": "f6",
|
||||||
|
"۷": "f7",
|
||||||
|
"۸": "f8",
|
||||||
|
"۹": "f9",
|
||||||
|
// Arabic numbers
|
||||||
|
"۰": "f10",
|
||||||
|
"١": "f1",
|
||||||
|
"٢": "f2",
|
||||||
|
"٣": "f3",
|
||||||
|
"٤": "f4",
|
||||||
|
"٥": "f5",
|
||||||
|
"٦": "f6",
|
||||||
|
"٧": "f7",
|
||||||
|
"٨": "f8",
|
||||||
|
"٩": "f9",
|
||||||
|
"٠": "f10"
|
||||||
|
}
|
Binary file not shown.
@ -204,7 +204,9 @@ public final class KeyModifier
|
|||||||
String name = null;
|
String name = null;
|
||||||
switch (k.getKind())
|
switch (k.getKind())
|
||||||
{
|
{
|
||||||
case Char: name = apply_fn_char(k.getChar()); break;
|
case Char:
|
||||||
|
KeyValue r = ComposeKey.apply(ComposeKeyData.fn, k.getChar());
|
||||||
|
return (r != null) ? r : k;
|
||||||
case Keyevent: name = apply_fn_keyevent(k.getKeyevent()); break;
|
case Keyevent: name = apply_fn_keyevent(k.getKeyevent()); break;
|
||||||
case Event: name = apply_fn_event(k.getEvent()); break;
|
case Event: name = apply_fn_event(k.getEvent()); break;
|
||||||
case Placeholder: name = apply_fn_placeholder(k.getPlaceholder()); break;
|
case Placeholder: name = apply_fn_placeholder(k.getPlaceholder()); break;
|
||||||
@ -264,193 +266,6 @@ public final class KeyModifier
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Return the name of modified key, or [null]. */
|
|
||||||
private static String apply_fn_char(char c)
|
|
||||||
{
|
|
||||||
switch (c)
|
|
||||||
{
|
|
||||||
case '1': return "f1";
|
|
||||||
case '2': return "f2";
|
|
||||||
case '3': return "f3";
|
|
||||||
case '4': return "f4";
|
|
||||||
case '5': return "f5";
|
|
||||||
case '6': return "f6";
|
|
||||||
case '7': return "f7";
|
|
||||||
case '8': return "f8";
|
|
||||||
case '9': return "f9";
|
|
||||||
case '0': return "f10";
|
|
||||||
case '<': return "«";
|
|
||||||
case '>': return "»";
|
|
||||||
case '{': return "‹";
|
|
||||||
case '}': return "›";
|
|
||||||
case '[': return "‘";
|
|
||||||
case ']': return "’";
|
|
||||||
case '(': return "“";
|
|
||||||
case ')': return "”";
|
|
||||||
case '\'': return "‚";
|
|
||||||
case '"': return "„";
|
|
||||||
case '-': return "–";
|
|
||||||
case '_': return "—";
|
|
||||||
case '^': return "¬";
|
|
||||||
case '%': return "‰";
|
|
||||||
case '=': return "≈";
|
|
||||||
case 'u': return "µ";
|
|
||||||
case 'a': return "æ";
|
|
||||||
case 'o': return "œ";
|
|
||||||
case '*': return "°";
|
|
||||||
case '.': return "…";
|
|
||||||
case ',': return "·";
|
|
||||||
case '!': return "¡";
|
|
||||||
case '?': return "¿";
|
|
||||||
case '|': return "¦";
|
|
||||||
case '§': return "¶";
|
|
||||||
case '†': return "‡";
|
|
||||||
case '×': return "∙";
|
|
||||||
case ' ': return "nbsp";
|
|
||||||
// arrows
|
|
||||||
case '↖': return "⇖";
|
|
||||||
case '↑': return "⇑";
|
|
||||||
case '↗': return "⇗";
|
|
||||||
case '←': return "⇐";
|
|
||||||
case '→': return "⇒";
|
|
||||||
case '↙': return "⇙";
|
|
||||||
case '↓': return "⇓";
|
|
||||||
case '↘': return "⇘";
|
|
||||||
case '↔': return "⇔";
|
|
||||||
case '↕': return "⇕";
|
|
||||||
// Currency symbols
|
|
||||||
case 'e': return "€";
|
|
||||||
case 'l': return "£";
|
|
||||||
case 'r': return "₹";
|
|
||||||
case 'y': return "¥";
|
|
||||||
case 'c': return "¢";
|
|
||||||
case 'p': return "₽";
|
|
||||||
case 'b': return "₱";
|
|
||||||
case 'h': return "₴";
|
|
||||||
case 'z': return "₿";
|
|
||||||
case '€': case '£': return "removed"; // Avoid showing these twice
|
|
||||||
// alternating greek letters
|
|
||||||
case 'π': return "ϖ";
|
|
||||||
case 'θ': return "ϑ";
|
|
||||||
case 'Θ': return "ϴ";
|
|
||||||
case 'ε': return "ϵ";
|
|
||||||
case 'β': return "ϐ";
|
|
||||||
case 'ρ': return "ϱ";
|
|
||||||
case 'σ': return "ς";
|
|
||||||
case 'γ': return "ɣ";
|
|
||||||
case 'φ': return "ϕ";
|
|
||||||
case 'υ': return "ϒ";
|
|
||||||
case 'κ': return "ϰ";
|
|
||||||
// alternating math characters
|
|
||||||
case '∪': return "⋃";
|
|
||||||
case '∩': return "⋂";
|
|
||||||
case '∃': return "∄";
|
|
||||||
case '∈': return "∉";
|
|
||||||
case '∫': return "∮";
|
|
||||||
case 'Π': return "∏";
|
|
||||||
case 'Σ': return "∑";
|
|
||||||
case '∨': return "⋁";
|
|
||||||
case '∧': return "⋀";
|
|
||||||
case '⊷': return "⊶";
|
|
||||||
case '⊂': return "⊆";
|
|
||||||
case '⊃': return "⊇";
|
|
||||||
case '±': return "∓";
|
|
||||||
// hebrew niqqud
|
|
||||||
case 'ק': return "qamats"; // kamatz
|
|
||||||
case 'ר': return "hataf_qamats"; // reduced kamatz
|
|
||||||
case 'ו': return "holam";
|
|
||||||
case 'ם': return "rafe";
|
|
||||||
case 'פ': return "patah"; // patach
|
|
||||||
case 'ש': return "sheva";
|
|
||||||
case 'ד': return "dagesh"; // or mapiq
|
|
||||||
case 'ח': return "hiriq";
|
|
||||||
case 'ף': return "hataf_patah"; // reduced patach
|
|
||||||
case 'ז': return "qubuts"; // kubuts
|
|
||||||
case 'ס': return "segol";
|
|
||||||
case 'ב': return "hataf_segol"; // reduced segol
|
|
||||||
case 'צ': return "tsere";
|
|
||||||
// Devanagari symbols
|
|
||||||
case 'ए': return "ऍ";
|
|
||||||
case 'े': return "ॅ";
|
|
||||||
case 'ऐ': return "ऎ";
|
|
||||||
case 'ै': return "ॆ";
|
|
||||||
case 'ऋ': return "ॠ";
|
|
||||||
case 'ृ': return "ॄ";
|
|
||||||
case 'ळ': return "ऴ";
|
|
||||||
case 'र': return "ऱ";
|
|
||||||
case 'क': return "क़";
|
|
||||||
case 'ख': return "ख़";
|
|
||||||
case 'ग': return "ग़";
|
|
||||||
case 'घ': return "ॻ";
|
|
||||||
case 'ढ': return "ढ़";
|
|
||||||
case 'न': return "ऩ";
|
|
||||||
case 'ड': return "ड़";
|
|
||||||
case 'ट': return "ॸ";
|
|
||||||
case 'ण': return "ॾ";
|
|
||||||
case 'फ': return "फ़";
|
|
||||||
case 'ऌ': return "ॡ";
|
|
||||||
case 'ॢ': return "ॣ";
|
|
||||||
case 'औ': return "ॵ";
|
|
||||||
case 'ौ': return "ॏ";
|
|
||||||
case 'ओ': return "ऒ";
|
|
||||||
case 'ो': return "ॊ";
|
|
||||||
case 'च': return "ॼ";
|
|
||||||
case 'ज': return "ज़";
|
|
||||||
case 'ब': return "ॿ";
|
|
||||||
case 'व': return "ॺ";
|
|
||||||
case 'य': return "य़";
|
|
||||||
case 'अ': return "ॲ";
|
|
||||||
case 'आ': return "ऑ";
|
|
||||||
case 'ा': return "ॉ";
|
|
||||||
case 'झ': return "ॹ";
|
|
||||||
case 'ई': return "ॴ";
|
|
||||||
case 'ी': return "ऻ";
|
|
||||||
case 'इ': return "ॳ";
|
|
||||||
case 'ि': return "ऺ";
|
|
||||||
case 'उ': return "ॶ";
|
|
||||||
case 'ऊ': return "ॷ";
|
|
||||||
case 'ु': return "ऄ";
|
|
||||||
case 'ष': return "क्ष";
|
|
||||||
case 'थ': return "त्र";
|
|
||||||
case 'द': return "द्र";
|
|
||||||
case 'प': return "प्र";
|
|
||||||
case 'श': return "श्र";
|
|
||||||
case 'छ': return "श्च";
|
|
||||||
case 'ँ': return "ऀ";
|
|
||||||
case '₹': return "₨";
|
|
||||||
case 'ॖ': return "ॗ";
|
|
||||||
case '॓': return "॔";
|
|
||||||
case '॰': return "ॱ";
|
|
||||||
case '।': return "॥";
|
|
||||||
case 'ं': return "ॕ";
|
|
||||||
case '़': return "ॎ";
|
|
||||||
case 'ऽ': return "ॽ";
|
|
||||||
// Persian numbers
|
|
||||||
case '۱': return "f1";
|
|
||||||
case '۲': return "f2";
|
|
||||||
case '۳': return "f3";
|
|
||||||
case '۴': return "f4";
|
|
||||||
case '۵': return "f5";
|
|
||||||
case '۶': return "f6";
|
|
||||||
case '۷': return "f7";
|
|
||||||
case '۸': return "f8";
|
|
||||||
case '۹': return "f9";
|
|
||||||
case '۰': return "f10";
|
|
||||||
// Arabic numbers
|
|
||||||
case '١': return "f1";
|
|
||||||
case '٢': return "f2";
|
|
||||||
case '٣': return "f3";
|
|
||||||
case '٤': return "f4";
|
|
||||||
case '٥': return "f5";
|
|
||||||
case '٦': return "f6";
|
|
||||||
case '٧': return "f7";
|
|
||||||
case '٨': return "f8";
|
|
||||||
case '٩': return "f9";
|
|
||||||
case '٠': return "f10";
|
|
||||||
default: return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static KeyValue apply_ctrl(KeyValue k)
|
private static KeyValue apply_ctrl(KeyValue k)
|
||||||
{
|
{
|
||||||
if (_modmap != null)
|
if (_modmap != null)
|
||||||
|
Loading…
Reference in New Issue
Block a user