Skip to content

Commit 243c1fb

Browse files
if-canBambooin
if-can
authored andcommitted
refactor: merge modifier state with the current keyboard's modifier state after sending combination keys
1 parent 04a3641 commit 243c1fb

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

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

+3-5
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,9 @@ class CommonKeyboardActionListener(
259259
}
260260
}
261261
}
262-
if (action.modifier == 0) {
263-
onKey(action.code, KeyboardSwitcher.currentKeyboard.modifier)
264-
} else {
265-
onKey(action.code, action.modifier)
266-
}
262+
val currentModifier = KeyboardSwitcher.currentKeyboard.modifier
263+
val combinedModifiers = action.modifier or currentModifier
264+
onKey(action.code, if (action.modifier == 0) currentModifier else combinedModifiers)
267265
}
268266
}
269267
}

0 commit comments

Comments
 (0)