mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-12-24 18:52:55 +03:00
Use CMD as modifier on MacOS instead of CTRL.
This commit is contained in:
parent
25dc138132
commit
5a52083f57
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user