Use CMD as modifier on MacOS instead of CTRL.

This commit is contained in:
Dain Nilsson 2022-06-09 12:29:51 +02:00
parent 25dc138132
commit 5a52083f57
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8
3 changed files with 7 additions and 3 deletions

View File

@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@ -104,7 +105,7 @@ class AccountDialog extends ConsumerWidget with AccountMixin {
autofocus: true,
onKey: (node, event) {
if (event is RawKeyDownEvent &&
event.isControlPressed &&
(Platform.isMacOS ? event.isMetaPressed : event.isControlPressed) &&
event.logicalKey == LogicalKeyboardKey.keyC) {
copyToClipboard(context, ref);
return KeyEventResult.handled;

View File

@ -1,4 +1,5 @@
import 'dart:async';
import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@ -109,7 +110,9 @@ class AccountView extends ConsumerWidget with AccountMixin {
return Focus(
onKey: (node, event) {
if (event is RawKeyDownEvent &&
event.isControlPressed &&
(Platform.isMacOS
? event.isMetaPressed
: event.isControlPressed) &&
event.logicalKey == LogicalKeyboardKey.keyC) {
triggerCopy();
return KeyEventResult.handled;

View File

@ -138,7 +138,7 @@ class _UnlockedViewState extends ConsumerState<_UnlockedView> {
onKey: (node, event) {
//TODO: Use Shortcuts, Intents, Actions
if (event is RawKeyDownEvent &&
event.isControlPressed &&
(Platform.isMacOS ? event.isMetaPressed : event.isControlPressed) &&
event.logicalKey == LogicalKeyboardKey.keyF) {
searchController.selection = TextSelection(
baseOffset: 0, extentOffset: searchController.text.length);