From 3bc9fa3df9a3d63227aac6fbc59cd13e2b1914d7 Mon Sep 17 00:00:00 2001 From: Denis Fokin Date: Fri, 18 Jul 2014 20:08:45 +0400 Subject: [PATCH] IDEA-111466 Mac OS X keyboard shortcuts with alt don't work under Oracle Java 7 --- .../openapi/keymap/impl/IdeKeyEventDispatcher.java | 10 ++++++++-- .../platform-resources-en/src/misc/registry.properties | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/IdeKeyEventDispatcher.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/IdeKeyEventDispatcher.java index 649cd2b10ee9..98498df8ecdc 100644 --- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/IdeKeyEventDispatcher.java +++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/IdeKeyEventDispatcher.java @@ -419,8 +419,14 @@ public final class IdeKeyEventDispatcher implements Disposable { KeyStroke originalKeyStroke=KeyStroke.getKeyStrokeForEvent(e); KeyStroke keyStroke=getKeyStrokeWithoutMouseModifiers(originalKeyStroke); - if (SystemInfo.isMac && SystemInfo.isOracleJvm && (keyStroke.getModifiers() & InputEvent.ALT_MASK) == InputEvent.ALT_MASK) { - keyStroke = getKeyStrokeWithoutCtrlModifier(keyStroke); + + + + if (Registry.is("fix.jdk7.alt.shortcuts") && SystemInfo.isMac && SystemInfo.isOracleJvm && (keyStroke.getModifiers() & InputEvent.ALT_MASK) == InputEvent.ALT_MASK) + { + if (KeymapManager.getInstance().getActiveKeymap().getActionIds(new KeyboardShortcut(keyStroke, null)).length == 0) { + keyStroke = getKeyStrokeWithoutCtrlModifier(keyStroke); + } } if (myKeyGestureProcessor.processInitState()) { diff --git a/platform/platform-resources-en/src/misc/registry.properties b/platform/platform-resources-en/src/misc/registry.properties index a5ca327945ef..ab422ac82cba 100644 --- a/platform/platform-resources-en/src/misc/registry.properties +++ b/platform/platform-resources-en/src/misc/registry.properties @@ -387,3 +387,7 @@ ide.new.project.settings.description=Temporary key for new project settings dial commonjs.complete.required.filename.with.extension=false commonjs.complete.required.filename.with.extension.description=If checked, required filenames are completed with extension + + +fix.jdk7.alt.shortcuts=true +fix.jdk7.alt.shortcuts.description=Allow to use alt for shortcuts on MacOSX with jdk7+ \ No newline at end of file