fix: IME filters out KEYCODE_BACK
This commit is contained in:
@@ -56,8 +56,8 @@ android {
|
||||
applicationId = "io.github.miuzarte.scrcpyforandroid"
|
||||
minSdk = 26
|
||||
targetSdk = 37
|
||||
versionCode = 27
|
||||
versionName = "0.3.1"
|
||||
versionCode = 28
|
||||
versionName = "0.3.2"
|
||||
|
||||
externalNativeBuild {
|
||||
cmake {
|
||||
|
||||
@@ -85,6 +85,7 @@ import io.github.miuzarte.scrcpyforandroid.scrcpy.Scrcpy
|
||||
import io.github.miuzarte.scrcpyforandroid.scrcpy.Shared.Codec
|
||||
import io.github.miuzarte.scrcpyforandroid.scrcpy.TouchEventHandler
|
||||
import io.github.miuzarte.scrcpyforandroid.services.AppRuntime
|
||||
import io.github.miuzarte.scrcpyforandroid.services.LocalInputService
|
||||
import io.github.miuzarte.scrcpyforandroid.storage.ScrcpyOptions
|
||||
import io.github.miuzarte.scrcpyforandroid.storage.Settings
|
||||
import io.github.miuzarte.scrcpyforandroid.storage.Storage
|
||||
@@ -1006,7 +1007,7 @@ fun ScrcpyVideoSurface(
|
||||
if (imeRequestToken == 0) return@LaunchedEffect
|
||||
val surfaceView = currentSurfaceView ?: return@LaunchedEffect
|
||||
surfaceView.setCommitTextEnabled(true)
|
||||
io.github.miuzarte.scrcpyforandroid.services.LocalInputService.showSoftKeyboard(surfaceView)
|
||||
LocalInputService.showSoftKeyboard(surfaceView)
|
||||
}
|
||||
|
||||
DisposableEffect(lifecycleOwner, session, currentSurface) {
|
||||
|
||||
@@ -36,6 +36,7 @@ class ScrcpyInputSurfaceView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
override fun onKeyPreIme(keyCode: Int, event: KeyEvent): Boolean {
|
||||
if (keyCode == KeyEvent.KEYCODE_BACK) return super.onKeyPreIme(keyCode, event)
|
||||
if (inputCallbacks?.handleKeyEvent(event) == true) return true
|
||||
return super.onKeyPreIme(keyCode, event)
|
||||
}
|
||||
@@ -58,6 +59,7 @@ class ScrcpyInputSurfaceView @JvmOverloads constructor(
|
||||
}
|
||||
|
||||
override fun sendKeyEvent(event: KeyEvent): Boolean {
|
||||
if (event.keyCode == KeyEvent.KEYCODE_BACK) return super.sendKeyEvent(event)
|
||||
if (inputCallbacks?.handleKeyEvent(event) == true) return true
|
||||
return super.sendKeyEvent(event)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user