private static int getNavigationKeyCode(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, IdeActions.ACTION_FIND_PREVIOUS -> {
            return KeyEvent.VK_UP;
          }
          case IdeActions.ACTION_EDITOR_MOVE_CARET_DOWN, IdeActions.ACTION_FIND_NEXT -> {
            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;
  }
private static int getNavigationKeyCode(KeyEvent e)