handle Cmd+Q on macOS (#1834)

* feat(video): add Pref.keyboardControl check &  support in video page

- 在 player_focus 处理按键事件前增加 Pref.keyboardControl 检查,允许禁用键盘快捷键
- 修复 Cmd+Q 事件被 Q 键逻辑拦截导致无法退出的问题

* Update player_focus.dart
This commit is contained in:
систем
2026-02-14 21:01:34 +08:00
committed by GitHub
parent e7e79eb62a
commit e104982246

View File

@@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:io' show exit, Platform;
import 'dart:math' as math;
import 'package:PiliPlus/pages/common/common_intro_controller.dart';
@@ -93,6 +94,9 @@ class PlayerFocus extends StatelessWidget {
final isKeyQ = key == LogicalKeyboardKey.keyQ;
if (isKeyQ || key == LogicalKeyboardKey.keyR) {
if (HardwareKeyboard.instance.isMetaPressed) {
if (isKeyQ && Platform.isMacOS) {
exit(0);
}
return true;
}
if (event is KeyDownEvent) {