CellFocusListener - possibility to get information about event source?

I am currently using Grid.addCellFocusListener() to detect when the user clicks into one of the grid’s cells.

Now i would like to distiguish between right-click and left-click (and maybe focus changes due to navigation with keyboard).

Possible somehow? Maybe with help of another listener (maybe also via Element API)?

GridContextMenu<String> gridContextMenu = sheetPreviewGrid.addContextMenu();
gridContextMenu.setDynamicContentHandler(e → {
handleFocusChange(lastFocusEvent, true);
return false;
});
sheetPreviewGrid.getElement().addEventListener(“click”,
e → handleFocusChange(lastFocusEvent, false));
sheetPreviewGrid.addCellFocusListener(e →
this.lastFocusEvent = e);

This hack does the trick. But still hoping for a clean solution.

yeah I think you’ll need to apply your own listener to the Grid with javascript. This cookbook recipe does something completely different, but I think it might point you in the right direction: https://cookbook.vaadin.com/grid-arrow-selection

i’ll give it a try, ty