@Override
    public void processKeys(Set<Integer> keys) {
        if (!isVisible()) return;

        if (keys.contains(KeyEvent.VK_DOWN)) {
            if (canSelectNext) {
                selectNextItem();
                canSelectNext = false;
            }
        }
        else canSelectNext = true;

        if (keys.contains(KeyEvent.VK_UP)) {
            if (canSelectPrev) {
                selectPrevItem();
                canSelectPrev = false;
            }
        }
        else canSelectPrev = true;

        if (keys.contains(KeyEvent.VK_ENTER)) {
            if (canDoAction && items.get(currentItem).isSelectable()) {
                lastItem = currentItem;
                items.get(currentItem).action.doAction(this);
                canDoAction = false;
            }
        }
        else canDoAction = true;
    }