skip segments with keyboard

Closes #1379

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-09-30 22:15:50 +08:00
parent 15b05cc454
commit 929c51e059
3 changed files with 34 additions and 7 deletions

View File

@@ -21,6 +21,7 @@ class PlayerFocus extends StatelessWidget {
this.introController,
required this.onSendDanmaku,
this.canPlay,
this.onSkipSegment,
});
final Widget child;
@@ -28,6 +29,7 @@ class PlayerFocus extends StatelessWidget {
final CommonIntroController? introController;
final VoidCallback onSendDanmaku;
final bool Function()? canPlay;
final bool Function()? onSkipSegment;
static bool _shouldHandle(LogicalKeyboardKey logicalKey) {
return logicalKey == LogicalKeyboardKey.tab ||
@@ -209,6 +211,9 @@ class PlayerFocus extends StatelessWidget {
return true;
case LogicalKeyboardKey.enter:
if (onSkipSegment?.call() ?? false) {
return true;
}
onSendDanmaku();
return true;
}