mirror of
https://github.com/HChaZZY/PiliPlus.git
synced 2025-12-24 19:16:44 +08:00
@@ -47,7 +47,7 @@ mixin TripleMixin on GetxController, TickerProvider {
|
||||
|
||||
static final _duration = Utils.isMobile
|
||||
? const Duration(milliseconds: 200)
|
||||
: const Duration(milliseconds: 230);
|
||||
: const Duration(milliseconds: 255);
|
||||
|
||||
void onStartTriple() {
|
||||
_timer ??= Timer(_duration, () {
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'package:PiliPlus/utils/storage_key.dart';
|
||||
import 'package:PiliPlus/utils/utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart'
|
||||
show KeyDownEvent, KeyUpEvent, LogicalKeyboardKey;
|
||||
show KeyDownEvent, KeyUpEvent, LogicalKeyboardKey, HardwareKeyboard;
|
||||
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';
|
||||
import 'package:get/get.dart';
|
||||
|
||||
@@ -131,6 +131,18 @@ class PlayerFocus extends StatelessWidget {
|
||||
}
|
||||
|
||||
if (event is KeyDownEvent) {
|
||||
final isDigit1 = key == LogicalKeyboardKey.digit1;
|
||||
if (isDigit1 || key == LogicalKeyboardKey.digit2) {
|
||||
if (HardwareKeyboard.instance.isShiftPressed && hasPlayer) {
|
||||
final speed = isDigit1 ? 1.0 : 2.0;
|
||||
if (speed != plPlayerController.playbackSpeed) {
|
||||
plPlayerController.setPlaybackSpeed(speed);
|
||||
SmartDialog.showToast('${speed}x播放');
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (key) {
|
||||
case LogicalKeyboardKey.space:
|
||||
if (plPlayerController.isLive || canPlay!()) {
|
||||
@@ -170,8 +182,10 @@ class PlayerFocus extends StatelessWidget {
|
||||
}
|
||||
return true;
|
||||
|
||||
case LogicalKeyboardKey.keyP when (Utils.isDesktop && hasPlayer):
|
||||
plPlayerController.toggleDesktopPip();
|
||||
case LogicalKeyboardKey.keyP:
|
||||
if (Utils.isDesktop && hasPlayer) {
|
||||
plPlayerController.toggleDesktopPip();
|
||||
}
|
||||
return true;
|
||||
|
||||
case LogicalKeyboardKey.keyM:
|
||||
@@ -185,6 +199,12 @@ class PlayerFocus extends StatelessWidget {
|
||||
}
|
||||
return true;
|
||||
|
||||
case LogicalKeyboardKey.keyS:
|
||||
if (hasPlayer && isFullScreen) {
|
||||
plPlayerController.takeScreenshot();
|
||||
}
|
||||
return true;
|
||||
|
||||
case LogicalKeyboardKey.enter:
|
||||
onSendDanmaku();
|
||||
return true;
|
||||
@@ -218,6 +238,14 @@ class PlayerFocus extends StatelessWidget {
|
||||
}
|
||||
return true;
|
||||
|
||||
case LogicalKeyboardKey.keyL:
|
||||
if (isFullScreen || plPlayerController.isDesktopPip) {
|
||||
plPlayerController.onLockControl(
|
||||
!plPlayerController.controlsLock.value,
|
||||
);
|
||||
}
|
||||
return true;
|
||||
|
||||
case LogicalKeyboardKey.bracketLeft:
|
||||
if (introController case final introController?) {
|
||||
if (!introController.prevPlay()) {
|
||||
|
||||
Reference in New Issue
Block a user