diff --git a/srcs/compose/dakuten.json b/srcs/compose/dakuten.json new file mode 100644 index 0000000..b3662de --- /dev/null +++ b/srcs/compose/dakuten.json @@ -0,0 +1,44 @@ +{ + "う": "ゔ", + "か": "が", + "き": "ぎ", + "く": "ぐ", + "け": "げ", + "こ": "ご", + "さ": "ざ", + "し": "じ", + "す": "ず", + "せ": "ぜ", + "そ": "ぞ", + "た": "だ", + "ち": "ぢ", + "つ": "づ", + "て": "で", + "と": "ど", + "は": "ば", + "ひ": "び", + "ふ": "ぶ", + "へ": "べ", + "ほ": "ぼ", + "ウ": "ヴ", + "カ": "ガ", + "キ": "ギ", + "ク": "グ", + "ケ": "ゲ", + "コ": "ゴ", + "サ": "ザ", + "シ": "ジ", + "ス": "ズ", + "セ": "ゼ", + "ソ": "ゾ", + "タ": "ダ", + "チ": "ヂ", + "ツ": "ヅ", + "テ": "デ", + "ト": "ド", + "ハ": "バ", + "ヒ": "ビ", + "フ": "ブ", + "ヘ": "ベ", + "ホ": "ボ" +} diff --git a/srcs/compose/handakuten.json b/srcs/compose/handakuten.json new file mode 100644 index 0000000..dc9046a --- /dev/null +++ b/srcs/compose/handakuten.json @@ -0,0 +1,12 @@ +{ + "は": "ぱ", + "ひ": "ぴ", + "ふ": "ぷ", + "へ": "ぺ", + "ほ": "ぽ", + "ハ": "パ", + "ヒ": "ピ", + "フ": "プ", + "ヘ": "ペ", + "ホ": "ポ" +} diff --git a/srcs/juloo.keyboard2/ComposeKeyData.java b/srcs/juloo.keyboard2/ComposeKeyData.java index 595fdfd..1149f54 100644 Binary files a/srcs/juloo.keyboard2/ComposeKeyData.java and b/srcs/juloo.keyboard2/ComposeKeyData.java differ diff --git a/srcs/juloo.keyboard2/KeyModifier.java b/srcs/juloo.keyboard2/KeyModifier.java index 5763e99..528da00 100644 --- a/srcs/juloo.keyboard2/KeyModifier.java +++ b/srcs/juloo.keyboard2/KeyModifier.java @@ -81,6 +81,8 @@ public final class KeyModifier case HORN: return apply_compose(k, ComposeKeyData.accent_horn); case HOOK_ABOVE: return apply_compose(k, ComposeKeyData.accent_hook_above); case ARROW_RIGHT: return apply_map_char(k, map_char_arrow_right); + case DAKUTEN: return apply_compose(k, ComposeKeyData.dakuten); + case HANDAKUTEN: return apply_compose(k, ComposeKeyData.handakuten); default: return k; } } diff --git a/srcs/juloo.keyboard2/KeyValue.java b/srcs/juloo.keyboard2/KeyValue.java index 2a329df..e88a7a3 100644 --- a/srcs/juloo.keyboard2/KeyValue.java +++ b/srcs/juloo.keyboard2/KeyValue.java @@ -44,6 +44,8 @@ public final class KeyValue implements Comparable TREMA, HORN, HOOK_ABOVE, + DAKUTEN, + HANDAKUTEN, SUPERSCRIPT, SUBSCRIPT, RING, @@ -298,10 +300,15 @@ public final class KeyValue implements Comparable return modifierKey(String.valueOf((char)symbol), m, flags | FLAG_KEY_FONT); } + private static KeyValue diacritic(String symbol, Modifier m, int flags) + { + return new KeyValue(symbol, Kind.Modifier, m.ordinal(), + FLAG_LATCH | FLAG_SPECIAL | flags); + } + private static KeyValue diacritic(int symbol, Modifier m) { - return new KeyValue(String.valueOf((char)symbol), Kind.Modifier, m.ordinal(), - FLAG_LATCH | FLAG_SPECIAL | FLAG_KEY_FONT); + return diacritic(String.valueOf((char)symbol), m, FLAG_KEY_FONT); } private static KeyValue eventKey(String symbol, Event e, int flags) @@ -448,6 +455,8 @@ public final class KeyValue implements Comparable case "accent_dot_below": return diacritic(0xE060, Modifier.DOT_BELOW); case "accent_horn": return diacritic(0xE061, Modifier.HORN); case "accent_hook_above": return diacritic(0xE062, Modifier.HOOK_ABOVE); + case "dakuten": return diacritic("゛", Modifier.DAKUTEN, 0); + case "handakuten": return diacritic("゜", Modifier.HANDAKUTEN, 0); case "superscript": return modifierKey("Sup", Modifier.SUPERSCRIPT, 0); case "subscript": return modifierKey("Sub", Modifier.SUBSCRIPT, 0); case "ordinal": return modifierKey("Ord", Modifier.ORDINAL, 0);