v1.1.9: Fix input activation not showing keyboard on Android TV

- Added SystemChannels.textInput.invokeMethod('TextInput.show') to force keyboard
- Used addPostFrameCallback to ensure widget state is updated before focus request
- Added support for gameButtonA and numpadEnter keys
This commit is contained in:
Michael committed 2025-12-10 19:49:10 +01:00
1 parent 2d332a50e8
commit b93b25b130
2 files changed
+11 -4

No files matched your search

@@ -591,7 +591,11 @@ class _TVTextFieldState extends State<_TVTextField> {
void _activateInput() {
setState(() => _isEditing = true);
// Wait for the widget to rebuild with canRequestFocus: true
WidgetsBinding.instance.addPostFrameCallback((_) {
_inputFocus.requestFocus();
SystemChannels.textInput.invokeMethod('TextInput.show');
});
}
@override
@@ -600,9 +604,12 @@ class _TVTextFieldState extends State<_TVTextField> {
focusNode: _navFocus,
onKeyEvent: (node, event) {
if (event is KeyDownEvent) {
if (event.logicalKey == LogicalKeyboardKey.select ||
event.logicalKey == LogicalKeyboardKey.enter ||
event.logicalKey == LogicalKeyboardKey.space) {
final key = event.logicalKey;
if (key == LogicalKeyboardKey.select ||
key == LogicalKeyboardKey.enter ||
key == LogicalKeyboardKey.space ||
key == LogicalKeyboardKey.gameButtonA ||
key == LogicalKeyboardKey.numpadEnter) {
_activateInput();
return KeyEventResult.handled;
}
@@ -108,7 +108,7 @@ class _MobileSettingsTabState extends ConsumerState<MobileSettingsTab> {
),
SizedBox(height: 4),
Text(
'Version 1.1.8',
'Version 1.1.9',
style: TextStyle(
fontSize: 13,
color: AppColors.textSecondary,