Skip to content

Commit c0528df

Browse files
committed
fix: keyboard layout sometimes inadvertently backed to the default layout
1 parent 1a74854 commit c0528df

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class Event(var s: String) {
2727
private var states: List<String>? = null
2828
var command: String = ""
2929
var option: String = ""
30-
var select: String? = null
30+
var select: String = ""
3131
private var toggle: String = ""
3232
var commit: String = ""
3333
private set

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ class KeyboardWindow(
265265
return
266266
}
267267
if (event.code == KeyEvent.KEYCODE_EISU) { // Switch keyboard
268-
switchKeyboard(event.select ?: ".default")
268+
switchKeyboard(event.select)
269269
} else {
270270
delegate.onEvent(event)
271271
}

app/src/main/java/com/osfans/trime/ime/text/TextInputManager.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,10 @@ class TextInputManager(
225225
}
226226
KeyEvent.KEYCODE_LANGUAGE_SWITCH -> { // Switch IME
227227
when {
228-
event.select!!.contentEquals(".next") -> {
228+
event.select == ".next" -> {
229229
trime.switchToNextIme()
230230
}
231-
!event.select.isNullOrEmpty() -> {
231+
event.select.isNotEmpty() -> {
232232
trime.switchToPrevIme()
233233
}
234234
else -> {

0 commit comments

Comments
 (0)