global escape

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-10-04 18:19:02 +08:00
parent 2aa9b46433
commit aa356b5376
2 changed files with 37 additions and 41 deletions

View File

@@ -264,8 +264,7 @@ class MyApp extends StatelessWidget {
child: child!, child: child!,
); );
if (Utils.isDesktop) { if (Utils.isDesktop) {
return MouseBackDetector( void onBack() {
onTapDown: () {
if (SmartDialog.checkExist()) { if (SmartDialog.checkExist()) {
SmartDialog.dismiss(); SmartDialog.dismiss();
return; return;
@@ -294,8 +293,17 @@ class MyApp extends StatelessWidget {
} }
Get.back(); Get.back();
}
return Shortcuts(
shortcuts: {
LogicalKeySet(LogicalKeyboardKey.escape):
VoidCallbackIntent(onBack),
}, },
child: MouseBackDetector(
onTapDown: onBack,
child: child, child: child,
),
); );
} }
return child; return child;

View File

@@ -163,18 +163,6 @@ class PlayerFocus extends StatelessWidget {
..controlsLock.value = false; ..controlsLock.value = false;
return true; return true;
case LogicalKeyboardKey.escape:
if (plPlayerController.controlsLock.value) {
plPlayerController.onLockControl(false);
} else if (plPlayerController.isDesktopPip) {
plPlayerController.exitDesktopPip();
} else if (isFullScreen) {
plPlayerController.triggerFullScreen(status: false);
} else {
Get.back();
}
return true;
case LogicalKeyboardKey.keyD: case LogicalKeyboardKey.keyD:
if (plPlayerController.isLive) { if (plPlayerController.isLive) {
final newVal = !plPlayerController.enableShowLiveDanmaku.value; final newVal = !plPlayerController.enableShowLiveDanmaku.value;