boolean (@NotNull KeyEvent keyEvent, boolean isRightKey) { ActionItem item = ObjectUtils.tryCast(getList().getSelectedValue(), ActionItem.class); ActionPopupStep step = ObjectUtils.tryCast(getListStep(), ActionPopupStep.class); if (step != null && item != null && step.isSelectable(item) && item.isKeepPopupOpen() && item.myAction instanceof ToggleAction toggleAction) { AnActionEvent event = step.createAnActionEvent(toggleAction, keyEvent); toggleAction.setSelected(event, isRightKey); step.updateStepItems(getList()); return true; } return false; }