mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
feat: map mode and translate mode receive side
This commit is contained in:
@@ -307,7 +307,7 @@ class InputService : AccessibilityService() {
|
||||
|
||||
} else {
|
||||
KeyEventConverter.toAndroidKeyEvent(keyEvent).let { event ->
|
||||
Log.d(logTag, "event $event text $text start $textSelectionStar end $textSelectionEnd")
|
||||
Log.d(logTag, "event $event text $text start $textSelectionStart end $textSelectionEnd")
|
||||
if (isShowingHint) {
|
||||
this.fakeEditTextForTextStateCalculation?.setText(null)
|
||||
} else {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package hbb;
|
||||
import android.view.KeyEvent
|
||||
import android.view.KeyCharacterMap
|
||||
import hbb.MessageOuterClass.KeyboardMode
|
||||
import hbb.MessageOuterClass.ControlKey
|
||||
|
||||
object KeyEventConverter {
|
||||
@@ -10,12 +11,14 @@ object KeyEventConverter {
|
||||
|
||||
android.util.Log.d(tag, "proto: $keyEventProto")
|
||||
|
||||
if (keyEventProto.hasUnicode()) {
|
||||
chrValue =
|
||||
}
|
||||
val keyboardMode = keyEventProto.getMode()
|
||||
|
||||
if (keyEventProto.hasChr()) {
|
||||
chrValue = convertUnicodeToKeyCode(keyEventProto.getChr() as Int)
|
||||
if (keyboardMode == KeyboardMode.Map || keyboardMode == KeyboardMode.Translate) {
|
||||
chrValue = keyEventProto.getChr()
|
||||
} else {
|
||||
chrValue = convertUnicodeToKeyCode(keyEventProto.getChr() as Int)
|
||||
}
|
||||
} else if (keyEventProto.hasControlKey()) {
|
||||
chrValue = convertControlKeyToKeyCode(keyEventProto.getControlKey())
|
||||
}
|
||||
@@ -29,6 +32,8 @@ object KeyEventConverter {
|
||||
}
|
||||
}
|
||||
|
||||
android.util.Log.d(tag, "modifiers: $modifiersList")
|
||||
|
||||
var action = 0
|
||||
if (keyEventProto.getDown()) {
|
||||
action = KeyEvent.ACTION_DOWN
|
||||
|
||||
Reference in New Issue
Block a user