Skip to content

Commit

Permalink
fix: keyboard layout sometimes inadvertently backed to the default la…
Browse files Browse the repository at this point in the history
…yout
  • Loading branch information
WhiredPlanck committed Aug 1, 2024
1 parent 1a74854 commit c0528df
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/src/main/java/com/osfans/trime/ime/keyboard/Event.kt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Event(var s: String) {
private var states: List<String>? = null
var command: String = ""
var option: String = ""
var select: String? = null
var select: String = ""
private var toggle: String = ""
var commit: String = ""
private set
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ class KeyboardWindow(
return
}
if (event.code == KeyEvent.KEYCODE_EISU) { // Switch keyboard
switchKeyboard(event.select ?: ".default")
switchKeyboard(event.select)
} else {
delegate.onEvent(event)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,10 +225,10 @@ class TextInputManager(
}
KeyEvent.KEYCODE_LANGUAGE_SWITCH -> { // Switch IME
when {
event.select!!.contentEquals(".next") -> {
event.select == ".next" -> {
trime.switchToNextIme()
}
!event.select.isNullOrEmpty() -> {
event.select.isNotEmpty() -> {
trime.switchToPrevIme()
}
else -> {
Expand Down

0 comments on commit c0528df

Please sign in to comment.