From b35d43a4c94f281554ebb25a4edf557a6e0f9d33 Mon Sep 17 00:00:00 2001 From: WhiredPlanck Date: Thu, 28 Nov 2024 22:03:04 +0800 Subject: [PATCH] fix: workaround for some text pattern cannot be simulated as key sequence --- app/src/main/java/com/osfans/trime/ime/keyboard/KeyAction.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/src/main/java/com/osfans/trime/ime/keyboard/KeyAction.kt b/app/src/main/java/com/osfans/trime/ime/keyboard/KeyAction.kt index c27736188f..cdce3c78f5 100644 --- a/app/src/main/java/com/osfans/trime/ime/keyboard/KeyAction.kt +++ b/app/src/main/java/com/osfans/trime/ime/keyboard/KeyAction.kt @@ -93,7 +93,7 @@ class KeyAction( init { val unbraced = raw.removeSurrounding("{", "}") // match like: { x: "{Control+a}" } - if (raw.matches(SINGLE_BRACED_STR)) { + if (raw.matches(BRACED_STR)) { val (c, m) = Keycode.parseSend(unbraced) if (c != KeyEvent.KEYCODE_UNKNOWN || m > 0) { code = c @@ -177,7 +177,6 @@ class KeyAction( } companion object { - private val SINGLE_BRACED_STR = Regex("""^\{[^{}]+\}$""") private val BRACED_STR = Regex("""\{[^{}]+\}""") private val KV_PATTERN = Regex("""(\\w+)=(\\w+)""")