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
+12 -5

No files matched your search

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