don't process pressed meta on linux

fix mac os keyboard layout on linux
This commit is contained in:
Sergey Ignatov
2018-01-29 20:51:40 +03:00
parent 0c8cb768ec
commit c04562d852
2 changed files with 11 additions and 0 deletions
@@ -398,6 +398,8 @@ public class IdeEventQueue extends EventQueue {
if (skipTypedKeyEventsIfFocusReturnsToOwner(e)) return;
if (isMetaKeyPressedOnLinux(e)) return;
checkForTimeJump();
if (!appIsLoaded()) {
@@ -466,6 +468,13 @@ public class IdeEventQueue extends EventQueue {
}
}
private static boolean isMetaKeyPressedOnLinux(@NotNull AWTEvent e) {
if (!Registry.is("keymap.skip.meta.press.on.linux")) return false;
boolean metaIsPressed = e instanceof InputEvent && (((InputEvent)e).getModifiersEx() & InputEvent.META_DOWN_MASK) != 0;
boolean typedKeyEvent = e.getID() == KeyEvent.KEY_TYPED;
return SystemInfo.isLinux && typedKeyEvent && metaIsPressed;
}
private boolean skipTypedKeyEventsIfFocusReturnsToOwner(@NotNull AWTEvent e) {
if (e.getID() == WindowEvent.WINDOW_LOST_FOCUS) {
WindowEvent wfe = (WindowEvent)e;
@@ -513,6 +513,8 @@ keymap.windows.as.meta.description='Windows' key press/release events would be p
keymap.windows.up.to.maximize.dialogs=true
keymap.windows.up.to.maximize.dialogs.description='Windows+Up' shortcut would maximize active dialog under Win 7+
keymap.skip.meta.press.on.linux=false
caches.indexerThreadsCount=-1
indexer.follows.symlinks=true