int (KeyEvent e) { KeyStroke keyStroke = KeyStroke.getKeyStrokeForEvent(e); if (isUpDownHomeEnd(e.getKeyCode())) { return e.getKeyCode(); } KeymapManager keymapManager = KeymapManager.getInstance(); if (keymapManager != null) { @NotNull String @NotNull [] actionIds = keymapManager.getActiveKeymap().getActionIds(keyStroke); for (String id : actionIds) { switch (id) { case IdeActions.ACTION_EDITOR_MOVE_CARET_UP -> { return KeyEvent.VK_UP; } case IdeActions.ACTION_EDITOR_MOVE_CARET_DOWN -> { return KeyEvent.VK_DOWN; } case IdeActions.ACTION_EDITOR_MOVE_LINE_START -> { return KeyEvent.VK_HOME; } case IdeActions.ACTION_EDITOR_MOVE_LINE_END -> { return KeyEvent.VK_END; } } } } return 0; }