Hi,
I’ve a few locations in code where I’d like to allow users to open an UI in a new page - e.g. when the user presses “CTRL” when clicking on a MenuItem. Is it possible to query the system which keys are
currently
pressed?
The code
MenuItem ellipsis = bar.addItem("", FontAwesome.ELLIPSIS_V, null);
ellipsis.addItem("Search...", e -> {
Search query =...;
// if CTRL is not pressed, open view in the same browser tab:
getUI().getNavigator().navigateTo(computeView(query));
// else (CTRL is pressed), open a new tab and navigate there:
String url = ... + computeView(query));
getUI().getPage().open(url, "_blank");
});
Thanks,
Marcel