From bfad94e237f047331d77aca9f2ca27328b5b9044 Mon Sep 17 00:00:00 2001 From: Artem Bochkarev Date: Mon, 12 Nov 2018 18:25:33 +0700 Subject: [PATCH] fixed IDEA-154117 Cannot bind Alt+S to an action --- .../intellij/openapi/keymap/impl/ui/ShortcutTextField.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ShortcutTextField.java b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ShortcutTextField.java index cca76fe33016..0ad5e076a5cf 100644 --- a/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ShortcutTextField.java +++ b/platform/platform-impl/src/com/intellij/openapi/keymap/impl/ui/ShortcutTextField.java @@ -5,6 +5,7 @@ package com.intellij.openapi.keymap.impl.ui; import com.intellij.icons.AllIcons.General; import com.intellij.openapi.keymap.KeymapUtil; import com.intellij.openapi.ui.JBPopupMenu; +import com.intellij.openapi.util.SystemInfo; import com.intellij.openapi.util.registry.Registry; import com.intellij.ui.KeyStrokeAdapter; import com.intellij.ui.components.fields.ExtendableTextField; @@ -52,7 +53,10 @@ public final class ShortcutTextField extends ExtendableTextField { return; } } - if (e.getID() == KeyEvent.KEY_PRESSED) { + + // NOTE: when user presses 'Alt + Right' at Linux the IDE can receive next sequence KeyEvents: ALT_PRESSED -> RIGHT_RELEASED -> ALT_RELEASED + // RIGHT_PRESSED can be skipped, it depends on WM + if (e.getID() == KeyEvent.KEY_PRESSED || (SystemInfo.isLinux && e.getID() == KeyEvent.KEY_RELEASED)) { if (keyCode != KeyEvent.VK_SHIFT && keyCode != KeyEvent.VK_ALT && keyCode != KeyEvent.VK_CONTROL &&