mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-06 09:13:48 +08:00
skip segments with keyboard
Closes #1379 Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user