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 <linlong1266@gmail.com>
This commit is contained in:
fufesou committed 2026-09-28 21:51:24 +08:00
1 parent e6a21d9719
commit 303ba96b1f
1 file changed
+10
@@ -1,3 +1,4 @@
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'shortcut_constants.dart';
@@ -141,6 +142,15 @@ List<Map<String, dynamic>> filterDefaultBindingsForPlatform(
final filtered = <Map<String, dynamic>>[];
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;