make sure to ahve focus before sending keys
This commit is contained in:
+4
@@ -252,6 +252,10 @@ class GeckoSessionApiImpl : GeckoSessionApi {
|
|||||||
?: throw IllegalStateException("No active engine view")
|
?: throw IllegalStateException("No active engine view")
|
||||||
val view = engineView.asView()
|
val view = engineView.asView()
|
||||||
|
|
||||||
|
if (!view.hasFocus()) {
|
||||||
|
view.requestFocus()
|
||||||
|
}
|
||||||
|
|
||||||
val downEvent = android.view.KeyEvent(
|
val downEvent = android.view.KeyEvent(
|
||||||
android.view.KeyEvent.ACTION_DOWN, keyCode.toInt()
|
android.view.KeyEvent.ACTION_DOWN, keyCode.toInt()
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user