Skip to content

Commit

Permalink
fix: regression that return key from physical keyboard would duplicat…
Browse files Browse the repository at this point in the history
…e new line
  • Loading branch information
WhiredPlanck committed Dec 10, 2024
1 parent 31d3917 commit 9372e46
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,15 @@ open class TrimeInputMethodService : LifecycleInputMethodService() {
it.data.let event@{
val keyCode = it.value.keyCode
if (keyCode != KeyEvent.KEYCODE_UNKNOWN) {
// TODO: look for better workaround for this
if (keyCode == KeyEvent.KEYCODE_ENTER) {
handleReturnKey()
return
}
val eventTime = SystemClock.uptimeMillis()
if (it.modifiers.release) {
sendUpKeyEvent(eventTime, keyCode, it.modifiers.metaState)
} else {
// TODO: look for better workaround for this
if (keyCode == KeyEvent.KEYCODE_ENTER) {
handleReturnKey()
return
}
sendDownKeyEvent(eventTime, keyCode, it.modifiers.metaState)
}
} else {
Expand Down

0 comments on commit 9372e46

Please sign in to comment.