mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-05-30 23:58:13 +08:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user