How to submit a grid selection with Enter?

grid.addItemDoubleClickListener() works fine. I would like to enable grids to also submit with enter. How can i do that?

So you want Enter to function as selection key the way Space does?

If so, something like this would be a java-only solution:

        grid.addCellFocusListener(e->{
            if (e.getItem().isPresent()) {
                focusedPerson = e.getItem().get();
            } else {
                focusedPerson = null;
            }
        });
        UI.getCurrent().addShortcutListener(e->{
            if (focusedPerson != null) {
                if (grid.getSelectedItems().contains(focusedPerson)) {
                    grid.deselect(focusedPerson);
                } else {
                    grid.select(focusedPerson);
                }
            }
        }, Key.ENTER).listenOn(grid);

(where focusedPerson is a Person of course)

Thank you Rolf!