diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..ccb2b50 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,47 @@ +name: test + +on: + push: + branches: [test] + +jobs: + get-changed-files: + strategy: + matrix: + patch: + - 26key + - 35key + - 45key + - 45key-numbers + - 46key + runs-on: ubuntu-latest + steps: + - name: Fetch source code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v45 + - name: check-match + id: check-match + env: + ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} + ALL_CHANGED_FILES_COUNT: ${{ steps.changed-files.outputs.all_changed_files_count }} + VALUE: ${{ matrix.value }} + run: | + MATCH_FOUND=false + for file in ${ALL_CHANGED_FILES}; do + if [[ "$file" == "patches/*$VALUE.diff" || "$file" != patches/* ]]; then + echo "Matrix value '$value' matches changed file '$file'." + MATCH_FOUND=true + break + fi + done + echo "match=$MATCH_FOUND" >> $GITHUB_OUTPUT + - name: test + if: steps.check-match.outputs.match + env: + test: ${{ steps.check-match.outputs.match }} + run: echo $test diff --git a/1584768629373.png b/1584768629373.png deleted file mode 100644 index 56b607b..0000000 Binary files a/1584768629373.png and /dev/null differ diff --git a/1585658020690.png b/1585658020690.png deleted file mode 100644 index 56b607b..0000000 Binary files a/1585658020690.png and /dev/null differ diff --git a/1594129198513.jpg b/1594129198513.jpg deleted file mode 100644 index bd4416c..0000000 Binary files a/1594129198513.jpg and /dev/null differ diff --git a/fb8ecfbe7b7c15bc992dab82de41f85e.gif b/fb8ecfbe7b7c15bc992dab82de41f85e.gif deleted file mode 100644 index 86296d0..0000000 Binary files a/fb8ecfbe7b7c15bc992dab82de41f85e.gif and /dev/null differ diff --git a/patches/26key.patch b/patches/26key.patch new file mode 100644 index 0000000..51131de --- /dev/null +++ b/patches/26key.patch @@ -0,0 +1,292 @@ +diff --git a/app/src/main/java/org/fcitx/fcitx5/android/data/prefs/AppPrefs.kt b/app/src/main/java/org/fcitx/fcitx5/android/data/prefs/AppPrefs.kt +index f015295f..bd616784 100644 +--- a/app/src/main/java/org/fcitx/fcitx5/android/data/prefs/AppPrefs.kt ++++ b/app/src/main/java/org/fcitx/fcitx5/android/data/prefs/AppPrefs.kt +@@ -163,7 +163,7 @@ class AppPrefs(private val sharedPreferences: SharedPreferences) { + val spaceSwipeMoveCursor = + switch(R.string.space_swipe_move_cursor, "space_swipe_move_cursor", true) + val showLangSwitchKey = +- switch(R.string.show_lang_switch_key, "show_lang_switch_key", true) ++ switch(R.string.show_lang_switch_key, "show_lang_switch_key", false) + val langSwitchKeyBehavior = enumList( + R.string.lang_switch_key_behavior, + "lang_switch_key_behavior", +@@ -178,10 +178,10 @@ class AppPrefs(private val sharedPreferences: SharedPreferences) { + R.string.keyboard_height, + R.string.portrait, + "keyboard_height_percent", +- 33, ++ 25, + R.string.landscape, + "keyboard_height_percent_landscape", +- 53, ++ 49, + 10, + 90, + "%" +diff --git a/app/src/main/java/org/fcitx/fcitx5/android/data/theme/ThemeManager.kt b/app/src/main/java/org/fcitx/fcitx5/android/data/theme/ThemeManager.kt +index 5a758a8e..d0c1833a 100644 +--- a/app/src/main/java/org/fcitx/fcitx5/android/data/theme/ThemeManager.kt ++++ b/app/src/main/java/org/fcitx/fcitx5/android/data/theme/ThemeManager.kt +@@ -34,7 +34,7 @@ object ThemeManager { + ThemePreset.AMOLEDBlack, + ) + +- val DefaultTheme = ThemePreset.MaterialLight ++ val DefaultTheme = ThemePreset.PixelLight + + private val customThemes: MutableList = ThemeFilesManager.listThemes() + +diff --git a/app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/KeyDefPreset.kt b/app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/KeyDefPreset.kt +index 8c3767e0..bfeac359 100644 +--- a/app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/KeyDefPreset.kt ++++ b/app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/KeyDefPreset.kt +@@ -45,22 +45,18 @@ class SymbolKeyId( + viewId: Int, + percentWidth: Float = 0.14f, + variant: Variant = Variant.Normal, +- popup: Array? = null ++ behaviors: Set? = null, + ) : KeyDef( + Appearance.Text( +- displayText = symbol, ++ displayText = " ", + textSize = 23f, + percentWidth = percentWidth, + variant = variant, + viewId = viewId + ), +- setOf( ++ behaviors ?: setOf( + Behavior.Press(KeyAction.FcitxKeyAction(symbol)) + ), +- popup ?: arrayOf( +- Popup.Preview(symbol), +- Popup.Keyboard(symbol) +- ) + ) + + class SymbolKeyAlt( +diff --git a/app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/TextKeyboard.kt b/app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/TextKeyboard.kt +index 51ac2bd4..ab5f5ba5 100644 +--- a/app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/TextKeyboard.kt ++++ b/app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/TextKeyboard.kt +@@ -7,6 +7,7 @@ package org.fcitx.fcitx5.android.input.keyboard + import android.annotation.SuppressLint + import android.content.Context + import android.graphics.Typeface ++import android.view.View + import androidx.annotation.Keep + import androidx.core.view.allViews + import org.fcitx.fcitx5.android.R +@@ -23,7 +24,6 @@ import org.fcitx.fcitx5.android.input.keyboard.KeyDef.Appearance.Variant + import org.fcitx.fcitx5.android.input.keyboard.KeyDef.Behavior + import org.fcitx.fcitx5.android.input.keyboard.KeyDef.Popup + import org.fcitx.fcitx5.android.input.popup.PopupAction +-import org.fcitx.fcitx5.android.input.popup.formContext + import splitties.views.imageResource + + @SuppressLint("ViewConstructor") +@@ -38,82 +38,60 @@ class TextKeyboard( + + val Layout: List> = listOf( + listOf( +- // @formatter:off +- AlphabetKeyNew("1", "!", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_1), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "!".uppercase(), default = false)))), +- AlphabetKeyNew("2", "@", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_2), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "@".uppercase(), default = false)))), +- AlphabetKeyNew("3", "#", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_3), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "#".uppercase(), default = false)))), +- AlphabetKeyNew("4", "$", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_4), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "$".uppercase(), default = false)))), +- AlphabetKeyNew("5", "%", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_5), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "%".uppercase(), default = false)))), +- AlphabetKeyNew("6", "^", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_6), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "^".uppercase(), default = false)))), +- AlphabetKeyNew("7", "&", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_7), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "&".uppercase(), default = false)))), +- AlphabetKeyNew("8", "*", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_8), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "*".uppercase(), default = false)))), +- AlphabetKeyNew("9", "(", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_9), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "(".uppercase(), default = false)))), +- AlphabetKeyNew("0", ")", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_0), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = ")".uppercase(), default = false)))) +- // @formatter:on ++ AlphabetKey("Q", "1"), ++ AlphabetKey("W", "2"), ++ AlphabetKey("E", "3"), ++ AlphabetKey("R", "4"), ++ AlphabetKey("T", "5"), ++ AlphabetKey("Y", "6"), ++ AlphabetKey("U", "7"), ++ AlphabetKey("I", "8"), ++ AlphabetKey("O", "9"), ++ AlphabetKey("P", "0") + ), listOf( +- AlphabetKeyNew("Q", "`"), +- AlphabetKeyNew("W", "~"), +- AlphabetKeyNew("E", "+"), +- AlphabetKeyNew("R", "-"), +- AlphabetKeyNew("T", "="), +- AlphabetKeyNew("Y", "_"), +- AlphabetKeyNew("U", "{"), +- AlphabetKeyNew("I", "}"), +- AlphabetKeyNew("O", "["), +- AlphabetKeyNew("P", "]") +- ), listOf( +- AlphabetKeyNew("A", "\\", percentWidth = 0.095f), +- AlphabetKeyNew("S", "|", percentWidth = 0.095f), +- AlphabetKeyNew("D", "×", percentWidth = 0.095f), +- AlphabetKeyNew("F", "÷", percentWidth = 0.095f), +- AlphabetKeyNew("G", "←", percentWidth = 0.095f), +- AlphabetKeyNew("H", "→", percentWidth = 0.095f), +- AlphabetKeyNew("J", formContext[7].component1(), percentWidth = 0.095f), +- AlphabetKeyNew("K", formContext[8].component1(), percentWidth = 0.095f), +- AlphabetKeyNew("L", formContext[9].component1(), percentWidth = 0.095f), +- AlphabetKeyNew( +- ";", +- ":", +- percentWidth = 0.095f, +- behavior = setOf( +- Behavior.Press(KeyAction.FcitxKeyAction(";")), +- Behavior.Swipe(KeyAction.FcitxKeyAction(":")) +- ) +- ), ++ AlphabetKey("A", "@"), ++ AlphabetKey("S", "*"), ++ AlphabetKey("D", "+"), ++ AlphabetKey("F", "-"), ++ AlphabetKey("G", "="), ++ AlphabetKey("H", "/"), ++ AlphabetKey("J", "#"), ++ AlphabetKey("K", "("), ++ AlphabetKey("L", ")") + ), listOf( + CapsKey(), +- AlphabetKeyNew("Z", formContext[0].component1()), +- AlphabetKeyNew("X", formContext[1].component1()), +- AlphabetKeyNew("C", formContext[2].component1()), +- AlphabetKeyNew("V", formContext[3].component1()), +- AlphabetKeyNew("B", formContext[4].component1()), +- AlphabetKeyNew("N", formContext[5].component1()), +- AlphabetKeyNew("M", formContext[6].component1()), ++ AlphabetKey("Z", "'"), ++ AlphabetKey("X", ":"), ++ AlphabetKey("C", "\""), ++ AlphabetKey("V", "?"), ++ AlphabetKey("B", "!"), ++ AlphabetKey("N", "~"), ++ AlphabetKey("M", "\\"), + BackspaceKey() + ), listOf( + // @formatter:off +- KeyDef( +- Appearance.ImageText(" ", src = R.drawable.ic_baseline_tag_faces_24, textSize = 16f, textStyle = Typeface.NORMAL, percentWidth = 0.15f, variant = Variant.Alternative, viewId = R.id.button_number,), setOf( Behavior.Press(KeyAction.LayoutSwitchAction("")), Behavior.Swipe(KeyAction.PickerSwitchAction())), +- arrayOf( +- Popup.Menu(arrayOf( +- Popup.Menu.Item("Emoji", R.drawable.ic_baseline_tag_faces_24, KeyAction.PickerSwitchAction()), +- Popup.Menu.Item("QuickPhrase", R.drawable.ic_baseline_format_quote_24, KeyAction.QuickPhraseAction), +- Popup.Menu.Item("Unicode", R.drawable.ic_logo_unicode, KeyAction.UnicodeAction) +- )) +- )), +- // @formatter:on ++ KeyDef(Appearance.ImageText( " ", src = R.drawable.ic_baseline_tag_faces_24, textSize = 16f, textStyle = Typeface.NORMAL, percentWidth = 0.15f, variant = Variant.Alternative, viewId = R.id.button_number,), setOf( Behavior.Press(KeyAction.LayoutSwitchAction("")), Behavior.Swipe(KeyAction.PickerSwitchAction()))), ++ SymbolKeyId( ",", R.id.button_left, variant = Variant.Alternative, behaviors = setOf( ++ Behavior.Press(KeyAction.FcitxKeyAction(",")), ++ Behavior.SwipeCustomize(KeyAction.FcitxKeyAction(","), Swipe.Up), ++ Behavior.SwipeCustomize(KeyAction.FcitxKeyAction(","), Swipe.Down) ++ )), + LanguageKey(), +- AlphabetKey("/", "?"), +- AlphabetKey(",", "<"), + SpaceKey(), +- AlphabetKey(".", ">"), +- AlphabetKey("'", "\""), ++ SymbolKeyId( ".", R.id.button_right, variant = Variant.Alternative, behaviors = setOf( ++ Behavior.Press(KeyAction.FcitxKeyAction(".")), ++ Behavior.SwipeCustomize(KeyAction.FcitxKeyAction("."), Swipe.Up), ++ Behavior.SwipeCustomize(KeyAction.FcitxKeyAction("."), Swipe.Down) ++ )), + ReturnKey() +- ) ++ // @formatter:on ++ ) + ) + } + + val buttonNumber: TextKeyView by lazy { findViewById(R.id.button_number) } ++ val buttonLeft: TextKeyView by lazy { findViewById(R.id.button_left) } ++ val buttonRight: TextKeyView by lazy { findViewById(R.id.button_right) } + + val caps: ImageKeyView by lazy { findViewById(R.id.button_caps) } + val backspace: ImageKeyView by lazy { findViewById(R.id.button_backspace) } +@@ -136,6 +114,16 @@ class TextKeyboard( + showLangSwitchKey.registerOnChangeListener(showLangSwitchKeyListener) + caps.swipeEnabled = false + buttonNumber.mainText.text = buildString { append("?123") } ++ buttonLeft.mainText.text = buildString { append(",") } ++ buttonRight.mainText.text = buildString { append(".") } ++ val symbolKeyClickListener = { v: View -> ++ // @formatter:off ++ v as TextKeyView ++ super.onAction(KeyAction.FcitxKeyAction(v.mainText.text.toString()), KeyActionListener.Source.Keyboard) ++ // @formatter:on ++ } ++ buttonRight.setOnClickListener(symbolKeyClickListener) ++ buttonLeft.setOnClickListener(symbolKeyClickListener) + } + + private val textKeys: List by lazy { +@@ -204,12 +192,13 @@ class TextKeyboard( + + override fun onPanelUpdate(status: Boolean) { + buttonNumber.mainText.text = buildString { append(if (status) "Esc" else "?123") } +- `return`.swipeEnabled = status ++ buttonLeft.mainText.text = buildString { append(if (status) ";" else ",") } ++ buttonRight.mainText.text = buildString { append(if (status) "'" else ".") } ++ + if (status) { + buttonNumber.setOnClickListener { + onAction(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_Escape))) + } +- + buttonNumber.setOnLongClickListener { + onAction(KeyAction.LayoutSwitchAction("")) + true +@@ -218,28 +207,13 @@ class TextKeyboard( + buttonNumber.setOnClickListener { + onAction(KeyAction.LayoutSwitchAction("")) + } +- +- buttonNumber.popupMenu( +- Popup.Menu( +- arrayOf( +- Popup.Menu.Item( +- "Emoji", +- R.drawable.ic_baseline_tag_faces_24, +- KeyAction.PickerSwitchAction() +- ), +- Popup.Menu.Item( +- "QuickPhrase", +- R.drawable.ic_baseline_format_quote_24, +- KeyAction.QuickPhraseAction +- ), +- Popup.Menu.Item( +- "Unicode", +- R.drawable.ic_logo_unicode, +- KeyAction.UnicodeAction +- ) +- ) +- ) +- ) ++ // @formatter:off ++ buttonNumber.popupMenu(Popup.Menu(arrayOf( ++ Popup.Menu.Item("Emoji", R.drawable.ic_baseline_tag_faces_24, KeyAction.PickerSwitchAction()), ++ Popup.Menu.Item("QuickPhrase", R.drawable.ic_baseline_format_quote_24, KeyAction.QuickPhraseAction), ++ Popup.Menu.Item("Unicode", R.drawable.ic_logo_unicode, KeyAction.UnicodeAction) ++ ))) ++ // @formatter:on + } + } + +@@ -333,8 +307,7 @@ class TextKeyboard( + } + + private fun updateLangSwitchKey(visible: Boolean) { +-// lang.visibility = if (visible) View.VISIBLE else View.GONE +- lang.visibility = GONE ++ lang.visibility = if (visible) VISIBLE else GONE + } + + private fun updateAlphabetKeys() { diff --git a/patches/35key.patch b/patches/35key.patch new file mode 100644 index 0000000..e236174 --- /dev/null +++ b/patches/35key.patch @@ -0,0 +1,268 @@ +diff --git a/app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/KeyDefPreset.kt b/app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/KeyDefPreset.kt +index 8c3767e0..54a8eebc 100644 +--- a/app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/KeyDefPreset.kt ++++ b/app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/KeyDefPreset.kt +@@ -16,6 +16,7 @@ import org.fcitx.fcitx5.android.input.keyboard.KeyDef.Appearance.Border + import org.fcitx.fcitx5.android.input.keyboard.KeyDef.Appearance.Variant + import org.fcitx.fcitx5.android.input.keyboard.KeyDef.Behavior + import org.fcitx.fcitx5.android.input.picker.PickerWindow ++import kotlin.Float + + val NumLockState = KeyStates(KeyState.NumLock, KeyState.Virtual) + +@@ -91,13 +92,15 @@ class AlphabetKey( + val character: String, + val punctuation: String, + variant: Variant = Variant.Normal, +- popup: Array? = null ++ popup: Array? = null, ++ percentWidth: Float = 0.1f + ) : KeyDef( + Appearance.AltText( + displayText = character, + altText = punctuation, + textSize = 23f, +- variant = variant ++ variant = variant, ++ percentWidth = percentWidth + ), + setOf( + Behavior.Press(KeyAction.FcitxKeyAction(character)), +@@ -134,7 +137,7 @@ class AlphabetKeyNew( + variant: Variant = Variant.Normal, + behavior: Set? = null, + popup: Array? = null, +- percentWidth: Float = 0.1f, ++ percentWidth: Float = 0.14f, + ) : KeyDef( + Appearance.AltText( + percentWidth = percentWidth, +@@ -146,7 +149,18 @@ class AlphabetKeyNew( + ), + behavior ?: setOf( + Behavior.Press(KeyAction.FcitxKeyAction(character)), +- Behavior.Swipe(KeyAction.FcitxKeyAction(act = character.uppercase(), default = false)), ++ Behavior.SwipeCustomize( ++ KeyAction.FcitxKeyAction( ++ act = character.uppercase(), ++ default = false ++ ), BaseKeyboard.Swipe.Up ++ ), ++ Behavior.SwipeCustomize( ++ KeyAction.FcitxKeyAction( ++ act = punctuation.toString().uppercase(), ++ default = false ++ ), BaseKeyboard.Swipe.Down ++ ), + ), + popup ?: arrayOf( + Popup.AltPreview(character, punctuation), +diff --git a/app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/TextKeyboard.kt b/app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/TextKeyboard.kt +index 51ac2bd4..be938b4f 100644 +--- a/app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/TextKeyboard.kt ++++ b/app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/TextKeyboard.kt +@@ -38,58 +38,39 @@ class TextKeyboard( + + val Layout: List> = listOf( + listOf( +- // @formatter:off +- AlphabetKeyNew("1", "!", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_1), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "!".uppercase(), default = false)))), +- AlphabetKeyNew("2", "@", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_2), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "@".uppercase(), default = false)))), +- AlphabetKeyNew("3", "#", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_3), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "#".uppercase(), default = false)))), +- AlphabetKeyNew("4", "$", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_4), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "$".uppercase(), default = false)))), +- AlphabetKeyNew("5", "%", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_5), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "%".uppercase(), default = false)))), +- AlphabetKeyNew("6", "^", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_6), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "^".uppercase(), default = false)))), +- AlphabetKeyNew("7", "&", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_7), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "&".uppercase(), default = false)))), +- AlphabetKeyNew("8", "*", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_8), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "*".uppercase(), default = false)))), +- AlphabetKeyNew("9", "(", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_9), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "(".uppercase(), default = false)))), +- AlphabetKeyNew("0", ")", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_0), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = ")".uppercase(), default = false)))) +- // @formatter:on +- ), listOf( + AlphabetKeyNew("Q", "`"), +- AlphabetKeyNew("W", "~"), +- AlphabetKeyNew("E", "+"), +- AlphabetKeyNew("R", "-"), +- AlphabetKeyNew("T", "="), +- AlphabetKeyNew("Y", "_"), +- AlphabetKeyNew("U", "{"), +- AlphabetKeyNew("I", "}"), +- AlphabetKeyNew("O", "["), +- AlphabetKeyNew("P", "]") ++ AlphabetKeyNew("W", "!"), ++ AlphabetKeyNew("R", "@"), ++ AlphabetKeyNew("T", "#"), ++ AlphabetKeyNew("Y", "$"), ++ AlphabetKeyNew("L", "%"), ++ AlphabetKeyNew("P", "_") + ), listOf( +- AlphabetKeyNew("A", "\\", percentWidth = 0.095f), +- AlphabetKeyNew("S", "|", percentWidth = 0.095f), +- AlphabetKeyNew("D", "×", percentWidth = 0.095f), +- AlphabetKeyNew("F", "÷", percentWidth = 0.095f), +- AlphabetKeyNew("G", "←", percentWidth = 0.095f), +- AlphabetKeyNew("H", "→", percentWidth = 0.095f), +- AlphabetKeyNew("J", formContext[7].component1(), percentWidth = 0.095f), +- AlphabetKeyNew("K", formContext[8].component1(), percentWidth = 0.095f), +- AlphabetKeyNew("L", formContext[9].component1(), percentWidth = 0.095f), +- AlphabetKeyNew( +- ";", +- ":", +- percentWidth = 0.095f, +- behavior = setOf( +- Behavior.Press(KeyAction.FcitxKeyAction(";")), +- Behavior.Swipe(KeyAction.FcitxKeyAction(":")) +- ) +- ), ++ AlphabetKeyNew("S", "|"), ++ AlphabetKeyNew("D", "^"), ++ AlphabetKeyNew("F", "&"), ++ AlphabetKeyNew("G", "*"), ++ AlphabetKeyNew("H", "("), ++ AlphabetKeyNew("J", ")"), ++ AlphabetKeyNew("K", "=") ++ ), listOf( ++ AlphabetKeyNew("Z", "<"), ++ AlphabetKeyNew("X", ">"), ++ AlphabetKeyNew("C", "{"), ++ AlphabetKeyNew("V", "}"), ++ AlphabetKeyNew("B", "["), ++ AlphabetKeyNew("N", "]"), ++ AlphabetKeyNew("M", "·"), + ), listOf( ++ // @formatter:off + CapsKey(), +- AlphabetKeyNew("Z", formContext[0].component1()), +- AlphabetKeyNew("X", formContext[1].component1()), +- AlphabetKeyNew("C", formContext[2].component1()), +- AlphabetKeyNew("V", formContext[3].component1()), +- AlphabetKeyNew("B", formContext[4].component1()), +- AlphabetKeyNew("N", formContext[5].component1()), +- AlphabetKeyNew("M", formContext[6].component1()), ++ AlphabetKeyNew("A", behavior = setOf(Behavior.Press(KeyAction.FcitxKeyAction("A")), Behavior.SwipeCustomize( KeyAction.FcitxKeyAction( act = "A".uppercase(), default = false), Swipe.Up))), ++ AlphabetKeyNew("E", formContext[9].component1(), behavior = setOf(Behavior.Press(KeyAction.FcitxKeyAction("E")), Behavior.SwipeCustomize( KeyAction.FcitxKeyAction( act = "E".uppercase(), default = false), Swipe.Up), Behavior.SwipeCustomize(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_l), KeyStates(KeyState.Ctrl)), Swipe.Down))), ++ AlphabetKeyNew("U", "÷"), ++ AlphabetKeyNew("I", formContext[9].component1(), behavior = setOf(Behavior.Press(KeyAction.FcitxKeyAction("I")), Behavior.SwipeCustomize( KeyAction.FcitxKeyAction( act = "I".uppercase(), default = false), Swipe.Up), Behavior.SwipeCustomize(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_l), KeyStates(KeyState.Ctrl)), Swipe.Down))), ++ AlphabetKeyNew("O", behavior = setOf(Behavior.Press(KeyAction.FcitxKeyAction("O")), Behavior.SwipeCustomize( KeyAction.FcitxKeyAction( act = "O".uppercase(), default = false), Swipe.Up))), + BackspaceKey() ++ // @formatter:on + ), listOf( + // @formatter:off + KeyDef( +@@ -103,11 +84,11 @@ class TextKeyboard( + )), + // @formatter:on + LanguageKey(), +- AlphabetKey("/", "?"), +- AlphabetKey(",", "<"), ++ AlphabetKey(".", "?", percentWidth = 0.13f), ++ AlphabetKey(",", "/", percentWidth = 0.13f), + SpaceKey(), +- AlphabetKey(".", ">"), +- AlphabetKey("'", "\""), ++ AlphabetKey(";", ":", percentWidth = 0.13f), ++ AlphabetKey("'", "\"", percentWidth = 0.13f), + ReturnKey() + ) + ) +@@ -274,7 +255,13 @@ class TextKeyboard( + + override fun onInputMethodUpdate(ime: InputMethodEntry) { + space.mainText.text = buildString { +- append(if (ime.label == "En") ime.name else ime.label) ++ append( ++ when (ime.label) { ++ "En" -> ime.name ++ "ㄓ" -> "" ++ else -> ime.label ++ } ++ ) + ime.subMode.run { name.ifEmpty { label.ifEmpty { null } } }?.let { append(" $it") } + } + if (capsState != CapsState.None) { +diff --git a/app/src/main/java/org/fcitx/fcitx5/android/input/popup/PopupPreset.kt b/app/src/main/java/org/fcitx/fcitx5/android/input/popup/PopupPreset.kt +index ecd4bb1f..c7581cfe 100644 +--- a/app/src/main/java/org/fcitx/fcitx5/android/input/popup/PopupPreset.kt ++++ b/app/src/main/java/org/fcitx/fcitx5/android/input/popup/PopupPreset.kt +@@ -11,7 +11,6 @@ import org.fcitx.fcitx5.android.core.KeyStates + import org.fcitx.fcitx5.android.core.KeySym + import org.fcitx.fcitx5.android.input.clipboard.ClipboardWindow + import org.fcitx.fcitx5.android.input.keyboard.KeyAction +-import org.fcitx.fcitx5.android.input.keyboard.KeyDef.Behavior + + /** + * based on +@@ -41,25 +40,24 @@ val PopupPreset: Map> = hashMapOf( + // Latin + // + "q" to arrayOf("`", "q", "Q"), +- "w" to arrayOf("~", "w", "W"), +- "e" to arrayOf("+", "e", "E", "ê", "ë", "ē", "é", "ě", "è", "ė", "ę", "ȩ", "ḝ", "ə"), +- "r" to arrayOf("-", "r", "R"), +- "t" to arrayOf("=", "t", "T"), +- "y" to arrayOf("_", "y", "Y", "ÿ", "ұ", "ү", "ӯ", "ў"), +- "u" to arrayOf("{", "u", "U", "û", "ü", "ū", "ú", "ǔ", "ù"), +- "i" to arrayOf("}", "i", "I", "î", "ï", "ī", "í", "ǐ", "ì", "į", "ı"), +- "o" to arrayOf("[", "o", "O", "ô", "ö", "ō", "ó", "ǒ", "ò", "œ", "ø", "õ"), +- "p" to arrayOf("]", "p", "P"), +- "a" to arrayOf("\\", "a", "A", "â", "ä", "ā", "á", "ǎ", "à", "æ", "ã", "å"), +- "s" to arrayOf("|", "s", "S", "ß", "ś", "š", "ş"), +- "d" to arrayOf("×", "d", "D", "ð"), +- "f" to arrayOf("÷", "f", "F"), +- "g" to arrayOf("←", "g", "G", "ğ"), +- "h" to arrayOf("→", "h", "H"), +- "j" to arrayOf(formContext[7].component1(), "j", "J"), +- "k" to arrayOf(formContext[8].component1(), "k", "K"), +- "l" to arrayOf(formContext[9].component1(), "/", "l", "L", "ł"), +- ";" to arrayOf(":"), ++ "w" to arrayOf("1", "w", "W"), ++ "e" to arrayOf("↓", "e", "E", "ê", "ë", "ē", "é", "ě", "è", "ė", "ę", "ȩ", "ḝ", "ə"), ++ "r" to arrayOf("2", "r", "R"), ++ "t" to arrayOf("3", "t", "T"), ++ "y" to arrayOf("4", "y", "Y", "ÿ", "ұ", "ү", "ӯ", "ў"), ++ "u" to arrayOf("×", "u", "U", "û", "ü", "ū", "ú", "ǔ", "ù"), ++ "i" to arrayOf("←", "i", "I", "î", "ï", "ī", "í", "ǐ", "ì", "į", "ı"), ++ "o" to arrayOf("→", "o", "O", "ô", "ö", "ō", "ó", "ǒ", "ò", "œ", "ø", "õ"), ++ "p" to arrayOf("-", "p", "P"), ++ "a" to arrayOf("↑", "a", "A", "â", "ä", "ā", "á", "ǎ", "à", "æ", "ã", "å"), ++ "s" to arrayOf("\\", "s", "S", "ß", "ś", "š", "ş"), ++ "d" to arrayOf("6", "d", "D", "ð"), ++ "f" to arrayOf("7", "f", "F"), ++ "g" to arrayOf("8", "g", "G", "ğ"), ++ "h" to arrayOf("9", "h", "H"), ++ "j" to arrayOf("0", "j", "J"), ++ "k" to arrayOf("+", "k", "K"), ++ "l" to arrayOf("5", "l", "L", "ł"), + "z" to arrayOf(formContext[0].component1(), "Z", "z", "ž", "ź", "ż"), + "x" to arrayOf(formContext[1].component1(), "X", "x", "×"), + "c" to arrayOf(formContext[2].component1(), "C", "c", "ç", "ć", "č"), +@@ -89,7 +87,6 @@ val PopupPreset: Map> = hashMapOf( + "J" to arrayOf("↑", "j", "J"), + "K" to arrayOf("↓️️", "k", "K"), + "L" to arrayOf("/", "l", "L", "ł"), +- ";" to arrayOf(":"), + "Z" to arrayOf("z", "Z", "`", "Ž", "Ź", "Ż"), + "X" to arrayOf("x", "X"), + "C" to arrayOf("c", "C", "Ç", "Ć", "Č"), +@@ -164,11 +161,11 @@ val PopupPreset: Map> = hashMapOf( + // + // Punctuation + // +- "," to arrayOf("<", "≤", "?", "!", ":", ";", "_", "%", "$", "^", "&"), ++ "," to arrayOf("/", "?", "!", ":", ";", "_", "%", "$", "^", "&"), + "'" to arrayOf("\""), +- "." to arrayOf(">", "≥", ",", "!", ":", ";", "_", "%", "$", "^", "&"), ++ "." to arrayOf("?", "¿", "‽", ",", "!", ":", ";", "_", "%", "$", "^", "&"), + "-" to arrayOf("—", "–", "·"), +- "?" to arrayOf("¿", "‽"), ++ "?" to arrayOf(), + "'" to arrayOf("\"", "‘", "’", "‚", "›", "‹"), + "!" to arrayOf("¡"), + "\"" to arrayOf("“", "”", "„", "»", "«"), +@@ -181,6 +178,7 @@ val PopupPreset: Map> = hashMapOf( + "=" to arrayOf("∞", "≠", "≈"), + ">" to arrayOf("≥", "»", "›", "⟩"), + "°" to arrayOf("′", "″", "‴"), ++ ";" to arrayOf(":"), + // + // Currency + // diff --git a/patches/45key-numbers.patch b/patches/45key-numbers.patch new file mode 100644 index 0000000..a6df7e7 --- /dev/null +++ b/patches/45key-numbers.patch @@ -0,0 +1,134 @@ +diff --git a/app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/TextKeyboard.kt b/app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/TextKeyboard.kt +index 51ac2bd4..28ed98ff 100644 +--- a/app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/TextKeyboard.kt ++++ b/app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/TextKeyboard.kt +@@ -38,19 +38,6 @@ class TextKeyboard( + + val Layout: List> = listOf( + listOf( +- // @formatter:off +- AlphabetKeyNew("1", "!", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_1), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "!".uppercase(), default = false)))), +- AlphabetKeyNew("2", "@", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_2), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "@".uppercase(), default = false)))), +- AlphabetKeyNew("3", "#", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_3), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "#".uppercase(), default = false)))), +- AlphabetKeyNew("4", "$", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_4), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "$".uppercase(), default = false)))), +- AlphabetKeyNew("5", "%", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_5), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "%".uppercase(), default = false)))), +- AlphabetKeyNew("6", "^", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_6), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "^".uppercase(), default = false)))), +- AlphabetKeyNew("7", "&", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_7), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "&".uppercase(), default = false)))), +- AlphabetKeyNew("8", "*", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_8), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "*".uppercase(), default = false)))), +- AlphabetKeyNew("9", "(", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_9), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "(".uppercase(), default = false)))), +- AlphabetKeyNew("0", ")", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_0), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = ")".uppercase(), default = false)))) +- // @formatter:on +- ), listOf( + AlphabetKeyNew("Q", "`"), + AlphabetKeyNew("W", "~"), + AlphabetKeyNew("E", "+"), +@@ -62,24 +49,15 @@ class TextKeyboard( + AlphabetKeyNew("O", "["), + AlphabetKeyNew("P", "]") + ), listOf( +- AlphabetKeyNew("A", "\\", percentWidth = 0.095f), +- AlphabetKeyNew("S", "|", percentWidth = 0.095f), +- AlphabetKeyNew("D", "×", percentWidth = 0.095f), +- AlphabetKeyNew("F", "÷", percentWidth = 0.095f), +- AlphabetKeyNew("G", "←", percentWidth = 0.095f), +- AlphabetKeyNew("H", "→", percentWidth = 0.095f), +- AlphabetKeyNew("J", formContext[7].component1(), percentWidth = 0.095f), +- AlphabetKeyNew("K", formContext[8].component1(), percentWidth = 0.095f), ++ AlphabetKeyNew("A", "\\"), ++ AlphabetKeyNew("S", "|"), ++ AlphabetKeyNew("D", "×"), ++ AlphabetKeyNew("F", "÷"), ++ AlphabetKeyNew("G", "←"), ++ AlphabetKeyNew("H", "→"), ++ AlphabetKeyNew("J", "<"), ++ AlphabetKeyNew("K", ">"), + AlphabetKeyNew("L", formContext[9].component1(), percentWidth = 0.095f), +- AlphabetKeyNew( +- ";", +- ":", +- percentWidth = 0.095f, +- behavior = setOf( +- Behavior.Press(KeyAction.FcitxKeyAction(";")), +- Behavior.Swipe(KeyAction.FcitxKeyAction(":")) +- ) +- ), + ), listOf( + CapsKey(), + AlphabetKeyNew("Z", formContext[0].component1()), +@@ -103,12 +81,25 @@ class TextKeyboard( + )), + // @formatter:on + LanguageKey(), +- AlphabetKey("/", "?"), +- AlphabetKey(",", "<"), ++ AlphabetKey(".", "?"), ++ AlphabetKey(",", "/"), + SpaceKey(), +- AlphabetKey(".", ">"), ++ AlphabetKey(";", ":"), + AlphabetKey("'", "\""), + ReturnKey() ++ ), listOf( ++ // @formatter:off ++ AlphabetKeyNew("1", "!", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_1), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "!".uppercase(), default = false)))), ++ AlphabetKeyNew("2", "@", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_2), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "@".uppercase(), default = false)))), ++ AlphabetKeyNew("3", "#", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_3), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "#".uppercase(), default = false)))), ++ AlphabetKeyNew("4", "$", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_4), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "$".uppercase(), default = false)))), ++ AlphabetKeyNew("5", "%", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_5), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "%".uppercase(), default = false)))), ++ AlphabetKeyNew("6", "^", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_6), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "^".uppercase(), default = false)))), ++ AlphabetKeyNew("7", "&", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_7), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "&".uppercase(), default = false)))), ++ AlphabetKeyNew("8", "*", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_8), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "*".uppercase(), default = false)))), ++ AlphabetKeyNew("9", "(", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_9), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = "(".uppercase(), default = false)))), ++ AlphabetKeyNew("0", ")", behavior = setOf(Behavior.Press(KeyAction.SymAction(KeySym(FcitxKeyMapping.FcitxKey_0), KeyStates.Empty)), Behavior.Swipe(KeyAction.FcitxKeyAction(act = ")".uppercase(), default = false)))) ++ // @formatter:on + ) + ) + } +diff --git a/app/src/main/java/org/fcitx/fcitx5/android/input/popup/PopupPreset.kt b/app/src/main/java/org/fcitx/fcitx5/android/input/popup/PopupPreset.kt +index ecd4bb1f..ac531d3e 100644 +--- a/app/src/main/java/org/fcitx/fcitx5/android/input/popup/PopupPreset.kt ++++ b/app/src/main/java/org/fcitx/fcitx5/android/input/popup/PopupPreset.kt +@@ -56,10 +56,9 @@ val PopupPreset: Map> = hashMapOf( + "f" to arrayOf("÷", "f", "F"), + "g" to arrayOf("←", "g", "G", "ğ"), + "h" to arrayOf("→", "h", "H"), +- "j" to arrayOf(formContext[7].component1(), "j", "J"), +- "k" to arrayOf(formContext[8].component1(), "k", "K"), ++ "j" to arrayOf("<", "j", "J"), ++ "k" to arrayOf(">", "k", "K"), + "l" to arrayOf(formContext[9].component1(), "/", "l", "L", "ł"), +- ";" to arrayOf(":"), + "z" to arrayOf(formContext[0].component1(), "Z", "z", "ž", "ź", "ż"), + "x" to arrayOf(formContext[1].component1(), "X", "x", "×"), + "c" to arrayOf(formContext[2].component1(), "C", "c", "ç", "ć", "č"), +@@ -89,7 +88,6 @@ val PopupPreset: Map> = hashMapOf( + "J" to arrayOf("↑", "j", "J"), + "K" to arrayOf("↓️️", "k", "K"), + "L" to arrayOf("/", "l", "L", "ł"), +- ";" to arrayOf(":"), + "Z" to arrayOf("z", "Z", "`", "Ž", "Ź", "Ż"), + "X" to arrayOf("x", "X"), + "C" to arrayOf("c", "C", "Ç", "Ć", "Č"), +@@ -164,11 +162,11 @@ val PopupPreset: Map> = hashMapOf( + // + // Punctuation + // +- "," to arrayOf("<", "≤", "?", "!", ":", ";", "_", "%", "$", "^", "&"), ++ "," to arrayOf("/", "?", "!", ":", ";", "_", "%", "$", "^", "&"), + "'" to arrayOf("\""), +- "." to arrayOf(">", "≥", ",", "!", ":", ";", "_", "%", "$", "^", "&"), ++ "." to arrayOf("?" ,"¿", "‽", ",", "!", ":", ";", "_", "%", "$", "^", "&"), + "-" to arrayOf("—", "–", "·"), +- "?" to arrayOf("¿", "‽"), ++ "?" to arrayOf(), + "'" to arrayOf("\"", "‘", "’", "‚", "›", "‹"), + "!" to arrayOf("¡"), + "\"" to arrayOf("“", "”", "„", "»", "«"), +@@ -181,6 +179,7 @@ val PopupPreset: Map> = hashMapOf( + "=" to arrayOf("∞", "≠", "≈"), + ">" to arrayOf("≥", "»", "›", "⟩"), + "°" to arrayOf("′", "″", "‴"), ++ ";" to arrayOf(":"), + // + // Currency + // diff --git a/patches/45key.patch b/patches/45key.patch new file mode 100644 index 0000000..cda61ea --- /dev/null +++ b/patches/45key.patch @@ -0,0 +1,99 @@ +diff --git a/app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/TextKeyboard.kt b/app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/TextKeyboard.kt +index 51ac2bd4..5fba1cc3 100644 +--- a/app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/TextKeyboard.kt ++++ b/app/src/main/java/org/fcitx/fcitx5/android/input/keyboard/TextKeyboard.kt +@@ -62,24 +62,15 @@ class TextKeyboard( + AlphabetKeyNew("O", "["), + AlphabetKeyNew("P", "]") + ), listOf( +- AlphabetKeyNew("A", "\\", percentWidth = 0.095f), +- AlphabetKeyNew("S", "|", percentWidth = 0.095f), +- AlphabetKeyNew("D", "×", percentWidth = 0.095f), +- AlphabetKeyNew("F", "÷", percentWidth = 0.095f), +- AlphabetKeyNew("G", "←", percentWidth = 0.095f), +- AlphabetKeyNew("H", "→", percentWidth = 0.095f), +- AlphabetKeyNew("J", formContext[7].component1(), percentWidth = 0.095f), +- AlphabetKeyNew("K", formContext[8].component1(), percentWidth = 0.095f), ++ AlphabetKeyNew("A", "\\"), ++ AlphabetKeyNew("S", "|"), ++ AlphabetKeyNew("D", "×"), ++ AlphabetKeyNew("F", "÷"), ++ AlphabetKeyNew("G", "←"), ++ AlphabetKeyNew("H", "→"), ++ AlphabetKeyNew("J", "<"), ++ AlphabetKeyNew("K", ">"), + AlphabetKeyNew("L", formContext[9].component1(), percentWidth = 0.095f), +- AlphabetKeyNew( +- ";", +- ":", +- percentWidth = 0.095f, +- behavior = setOf( +- Behavior.Press(KeyAction.FcitxKeyAction(";")), +- Behavior.Swipe(KeyAction.FcitxKeyAction(":")) +- ) +- ), + ), listOf( + CapsKey(), + AlphabetKeyNew("Z", formContext[0].component1()), +@@ -103,10 +94,10 @@ class TextKeyboard( + )), + // @formatter:on + LanguageKey(), +- AlphabetKey("/", "?"), +- AlphabetKey(",", "<"), ++ AlphabetKey(".", "?"), ++ AlphabetKey(",", "/"), + SpaceKey(), +- AlphabetKey(".", ">"), ++ AlphabetKey(";", ":"), + AlphabetKey("'", "\""), + ReturnKey() + ) +diff --git a/app/src/main/java/org/fcitx/fcitx5/android/input/popup/PopupPreset.kt b/app/src/main/java/org/fcitx/fcitx5/android/input/popup/PopupPreset.kt +index ecd4bb1f..ac531d3e 100644 +--- a/app/src/main/java/org/fcitx/fcitx5/android/input/popup/PopupPreset.kt ++++ b/app/src/main/java/org/fcitx/fcitx5/android/input/popup/PopupPreset.kt +@@ -56,10 +56,9 @@ val PopupPreset: Map> = hashMapOf( + "f" to arrayOf("÷", "f", "F"), + "g" to arrayOf("←", "g", "G", "ğ"), + "h" to arrayOf("→", "h", "H"), +- "j" to arrayOf(formContext[7].component1(), "j", "J"), +- "k" to arrayOf(formContext[8].component1(), "k", "K"), ++ "j" to arrayOf("<", "j", "J"), ++ "k" to arrayOf(">", "k", "K"), + "l" to arrayOf(formContext[9].component1(), "/", "l", "L", "ł"), +- ";" to arrayOf(":"), + "z" to arrayOf(formContext[0].component1(), "Z", "z", "ž", "ź", "ż"), + "x" to arrayOf(formContext[1].component1(), "X", "x", "×"), + "c" to arrayOf(formContext[2].component1(), "C", "c", "ç", "ć", "č"), +@@ -89,7 +88,6 @@ val PopupPreset: Map> = hashMapOf( + "J" to arrayOf("↑", "j", "J"), + "K" to arrayOf("↓️️", "k", "K"), + "L" to arrayOf("/", "l", "L", "ł"), +- ";" to arrayOf(":"), + "Z" to arrayOf("z", "Z", "`", "Ž", "Ź", "Ż"), + "X" to arrayOf("x", "X"), + "C" to arrayOf("c", "C", "Ç", "Ć", "Č"), +@@ -164,11 +162,11 @@ val PopupPreset: Map> = hashMapOf( + // + // Punctuation + // +- "," to arrayOf("<", "≤", "?", "!", ":", ";", "_", "%", "$", "^", "&"), ++ "," to arrayOf("/", "?", "!", ":", ";", "_", "%", "$", "^", "&"), + "'" to arrayOf("\""), +- "." to arrayOf(">", "≥", ",", "!", ":", ";", "_", "%", "$", "^", "&"), ++ "." to arrayOf("?" ,"¿", "‽", ",", "!", ":", ";", "_", "%", "$", "^", "&"), + "-" to arrayOf("—", "–", "·"), +- "?" to arrayOf("¿", "‽"), ++ "?" to arrayOf(), + "'" to arrayOf("\"", "‘", "’", "‚", "›", "‹"), + "!" to arrayOf("¡"), + "\"" to arrayOf("“", "”", "„", "»", "«"), +@@ -181,6 +179,7 @@ val PopupPreset: Map> = hashMapOf( + "=" to arrayOf("∞", "≠", "≈"), + ">" to arrayOf("≥", "»", "›", "⟩"), + "°" to arrayOf("′", "″", "‴"), ++ ";" to arrayOf(":"), + // + // Currency + // diff --git a/test.txt b/test.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/test.txt @@ -0,0 +1 @@ +1