Skip to content

Commit

Permalink
Update TrimeInputMethodService.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
if-can committed Jan 5, 2025
1 parent a246105 commit f9f5b6e
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,16 +247,15 @@ open class TrimeInputMethodService : LifecycleInputMethodService() {
if (keyCode in KeyEvent.KEYCODE_NUMPAD_0..KeyEvent.KEYCODE_NUMPAD_EQUALS) {
// ignore KP_X keys, which is handled in `CommonKeyboardActionListener`.
// Requires this empty body becoz Kotlin request it
} else {
if (it.modifiers.shift) {
sendDownKeyEvent(eventTime, KeyEvent.KEYCODE_SHIFT_LEFT)
}
return
}

it.modifiers.shift.apply {
if (this) sendDownKeyEvent(eventTime, KeyEvent.KEYCODE_SHIFT_LEFT)

sendDownKeyEvent(eventTime, keyCode, it.modifiers.metaState)

if (it.modifiers.shift) {
sendUpKeyEvent(eventTime, KeyEvent.KEYCODE_SHIFT_LEFT)
}
if (this) sendUpKeyEvent(eventTime, KeyEvent.KEYCODE_SHIFT_LEFT)
}
}
} else {
Expand Down

0 comments on commit f9f5b6e

Please sign in to comment.