From e1049822464171273b6ab48123ea6716d2867792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D1=81=D0=B8=D1=81=D1=82=D0=B5=D0=BC?= Date: Sat, 14 Feb 2026 21:01:34 +0800 Subject: [PATCH] handle Cmd+Q on macOS (#1834) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat(video): add Pref.keyboardControl check & support in video page - 在 player_focus 处理按键事件前增加 Pref.keyboardControl 检查,允许禁用键盘快捷键 - 修复 Cmd+Q 事件被 Q 键逻辑拦截导致无法退出的问题 * Update player_focus.dart --- lib/pages/video/widgets/player_focus.dart | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/pages/video/widgets/player_focus.dart b/lib/pages/video/widgets/player_focus.dart index 6c685d90e..a9609775b 100644 --- a/lib/pages/video/widgets/player_focus.dart +++ b/lib/pages/video/widgets/player_focus.dart @@ -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) {