Skip to content

fix(tv): handle key repeat events for D-pad navigation - #2337

Open
usmanvrtx wants to merge 1 commit into
android_TV_implementationfrom
fix/tv-key-repeat-events
Open

fix(tv): handle key repeat events for D-pad navigation#2337
usmanvrtx wants to merge 1 commit into
android_TV_implementationfrom
fix/tv-key-repeat-events

Conversation

@usmanvrtx

Copy link
Copy Markdown
Contributor

Description

This PR fixes TV D-pad navigation when the user holds down a key (auto-repeat).
Previously only KeyDownEvent was handled, so repeated key events generated
while holding the D-pad button were ignored, causing slow/erratic scrolling and
navigation on TV remotes.

Related Issue

N/A

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)

What Has Changed

  • Updated _handleScopeKeyEvent in TVFocusWidget to also handle KeyRepeatEvent, so held D-pad keys continuously trigger back/scope navigation instead of only the initial press
  • Updated the onKeyEvent handler in TVScrollbarWidget to also handle KeyRepeatEvent, enabling smooth continuous scrolling while the UP/DOWN key is held

How to Test

  1. Run the relevant TV tests (if any): flutter test modules/ensemble/test/widget/tv_scrollbar_widget_test.dart
  2. On a TV/emulator, focus a ListView and hold the D-pad DOWN button — the list should scroll continuously while held
  3. Hold the BACK button — it should keep triggering the back handler rather than only once
  4. Verify normal single-press navigation still works as before

Screenshots / Videos

N/A

Checklist

  • I have run flutter analyze and addressed any new warnings
  • I have run flutter test and all tests pass
  • I have tested my changes on the relevant platform(s)
  • I have updated documentation if needed
  • My changes do not introduce new warnings or errors

@usmanvrtx
usmanvrtx requested review from TheNoumanDev and removed request for TheNoumanDev August 6, 2026 20:38
@usmanvrtx usmanvrtx self-assigned this Aug 6, 2026
@usmanvrtx
usmanvrtx marked this pull request as ready for review August 6, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant