From f760347d9db41e3f88ba8a239f69e141878822ad Mon Sep 17 00:00:00 2001 From: Armin Schrenk Date: Wed, 9 Jan 2019 15:28:05 +0100 Subject: [PATCH] fixes #787 --- .../cryptomator/ui/controllers/MainController.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/main/ui/src/main/java/org/cryptomator/ui/controllers/MainController.java b/main/ui/src/main/java/org/cryptomator/ui/controllers/MainController.java index 8a3153503..c401da43a 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/controllers/MainController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/controllers/MainController.java @@ -2,7 +2,7 @@ * Copyright (c) 2014, 2017 Sebastian Stenzel * All rights reserved. * This program and the accompanying materials are made available under the terms of the accompanying LICENSE file. - * + * * Contributors: * Sebastian Stenzel - initial API and implementation * Jean-Noël Charon - confirmation dialog on vault removal @@ -110,7 +110,7 @@ public class MainController implements ViewController { @Inject public MainController(@Named("mainWindow") Stage mainWindow, ExecutorService executorService, @Named("fileOpenRequests") BlockingQueue fileOpenRequests, ExitUtil exitUtil, Localization localization, - VaultFactory vaultFactoy, ViewControllerLoader viewControllerLoader, UpgradeStrategies upgradeStrategies, VaultList vaults, AutoUnlocker autoUnlocker) { + VaultFactory vaultFactoy, ViewControllerLoader viewControllerLoader, UpgradeStrategies upgradeStrategies, VaultList vaults, AutoUnlocker autoUnlocker) { this.mainWindow = mainWindow; this.executorService = executorService; this.fileOpenRequests = fileOpenRequests; @@ -331,7 +331,7 @@ public class MainController implements ViewController { /** * adds the given directory or selects it if it is already in the list of directories. - * + * * @param path to a vault directory or masterkey file */ public void addVault(final Path path, boolean select) { @@ -432,7 +432,13 @@ public class MainController implements ViewController { } private void didPressKeyOnRoot(KeyEvent event) { - if ((event.isMetaDown() || event.isControlDown()) && event.getCode().isDigitKey()) { + boolean triggered; + if (SystemUtils.IS_OS_MAC) { + triggered = event.isMetaDown(); + } else { + triggered = event.isControlDown() && !event.isAltDown(); + } + if (triggered && event.getCode().isDigitKey()) { int digit = Integer.valueOf(event.getText()); switch (digit) { case 0: {