fix(tv): route remote keys to native text input

This commit is contained in:
edde746
2026-05-23 19:19:59 +02:00
parent 4c43d6fdec
commit 993a0e4666
2 changed files with 22 additions and 23 deletions
+2 -6
View File
@@ -185,13 +185,9 @@ bool _shouldPassNativeTvKeyToPlatform({required bool usesTvKeyboard, required bo
// Android TV provides its own IME. Remote keys must reach the platform so
// users can move around that keyboard instead of escaping the app field.
// Some remotes (Chromecast) are reported by Flutter as keyboard events, so
// native TV navigation cannot rely on deviceType.
final key = event.logicalKey;
final isEngineSynthesizedTvSelect = key == LogicalKeyboardKey.select || key == LogicalKeyboardKey.gameButtonA;
if (event.isPhysicalKeyboardEvent && !isEngineSynthesizedTvSelect) {
_logTvTextInput('native-pass=false reason=physical-keyboard key=(${_describeTextInputKey(event)})');
return false;
}
final shouldPass = key.isDpadDirection || key.isBackKey || event.isTvSelectEvent;
_logTvTextInput(
'native-pass=$shouldPass reason=${shouldPass ? "remote-navigation-key" : "not-navigation-key"} '