feat(macos): add command-comma shortcut to open settings (#2715)
CI / format (push) Has been cancelled
CI / test (push) Has been cancelled
CI / packaging (push) Has been cancelled

This commit is contained in:
Shlomo
2025-09-22 03:35:51 +03:00
committed by GitHub
parent 343ef23448
commit dac49182f8
+9 -1
View File
@@ -27,7 +27,9 @@ class ShortcutWatcher extends StatelessWidget {
if (checkPlatform([TargetPlatform.linux])) LogicalKeySet(LogicalKeyboardKey.control, LogicalKeyboardKey.keyQ): _ExitAppIntent(),
// Add Command+W to close the window for macOS
if (checkPlatform([TargetPlatform.macOS])) LogicalKeySet(LogicalKeyboardKey.meta, LogicalKeyboardKey.keyW): _CloseWindowIntent(),
// Add Control+, to open settings for macOS
if (checkPlatform([TargetPlatform.macOS])) LogicalKeySet(LogicalKeyboardKey.meta, LogicalKeyboardKey.comma): _OpenSettingsIntent(),
LogicalKeySet(LogicalKeyboardKey.escape): _PopPageIntent(),
// Control+V and Command+V
@@ -55,6 +57,10 @@ class ShortcutWatcher extends StatelessWidget {
return null;
},
),
_OpenSettingsIntent: CallbackAction(onInvoke: (_) async {
context.redux(homePageControllerProvider).dispatch(ChangeTabAction(HomeTab.settings));
return null;
}),
},
child: child,
),
@@ -70,6 +76,8 @@ class _PasteIntent extends Intent {}
class _CloseWindowIntent extends Intent {}
class _OpenSettingsIntent extends Intent {}
bool _ignoreMetaLast = false;
bool _isFakeMetaKey() {
// https://github.com/localsend/localsend/issues/2037