Skip to content

Commit c42b500

Browse files
if-canBambooin
authored andcommitted
fix: theme preset trime combination keys not working
1 parent 7972858 commit c42b500

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/src/main/java/com/osfans/trime/ime/keyboard/KeyAction.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,22 +92,26 @@ class KeyAction(
9292

9393
init {
9494
val unbraced = raw.removeSurrounding("{", "}")
95+
var handled = false
9596
// match like: { x: "{Control+a}" }
9697
if (raw.matches(BRACED_STR)) {
9798
val (c, m) = Keycode.parseSend(unbraced)
9899
if (c != KeyEvent.KEYCODE_UNKNOWN || m > 0) {
99100
code = c
100101
modifier = m
102+
handled = true
101103
} else {
102104
// match: { x: { commit: a, text: b, label: c } }
103105
val action = decodeMapFromString(raw)
104106
if (action.isNotEmpty()) {
105107
commit = action["commit"] ?: ""
106108
text = action["text"] ?: ""
107109
label = action["label"] ?: ""
110+
handled = true
108111
}
109112
}
110-
} else {
113+
}
114+
if (!handled) {
111115
val theme = ThemeManager.activeTheme
112116
// match like: { x: BackSpace } -> preset_keys/BackSpace: {..., send: BackSpace }
113117
if (theme.presetKeys!!.containsKey(unbraced)) {

0 commit comments

Comments
 (0)