Skip to content

Commit

Permalink
fix: shift + arrow keys not working to select text
Browse files Browse the repository at this point in the history
Update TrimeInputMethodService.kt

Update TrimeInputMethodService.kt
  • Loading branch information
if-can committed Jan 5, 2025
1 parent 46916af commit 551808e
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +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 {
return
}

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

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

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

0 comments on commit 551808e

Please sign in to comment.