From 303ba96b1f112a2ee127abfa8bd0d251e45d9f09 Mon Sep 17 00:00:00 2001 From: fufesou Date: Mon, 28 Sep 2026 21:51:24 +0800 Subject: [PATCH] refact(shortcuts): empty default shortcuts for Cmd+Option+Shift+Del on macOS and iOS Because Del may be ambiguous for new macOS users. Cmd+Option+Shift+Backspace is "Empty Trash without confirmation" shortcut on macOS. Signed-off-by: fufesou --- .../widgets/keyboard_shortcuts/shortcut_utils.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/flutter/lib/common/widgets/keyboard_shortcuts/shortcut_utils.dart b/flutter/lib/common/widgets/keyboard_shortcuts/shortcut_utils.dart index 58f85fbdd..f62650720 100644 --- a/flutter/lib/common/widgets/keyboard_shortcuts/shortcut_utils.dart +++ b/flutter/lib/common/widgets/keyboard_shortcuts/shortcut_utils.dart @@ -1,3 +1,4 @@ +import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; import 'shortcut_constants.dart'; @@ -141,6 +142,15 @@ List> filterDefaultBindingsForPlatform( final filtered = >[]; for (final binding in shortcutBindingMapsFrom(bindings)) { final action = binding['action'] as String?; + // Compact Apple keyboards can label Backspace as Delete, making this + // default ambiguous. Using Backspace also conflicts with Finder's + // "Empty Trash without confirmation" shortcut on macOS. + // Leave it unbound; users can still record their own shortcut. + if ((defaultTargetPlatform == TargetPlatform.macOS || + defaultTargetPlatform == TargetPlatform.iOS) && + action == kShortcutActionSendCtrlAltDel) { + continue; + } if (!cap.includeFullscreenShortcut && action == kShortcutActionToggleFullscreen) { continue;