Could you please advise in situation: I have ScrollPane and GridPane in it. In GridPane i have many buttons. When i focused one button by mouse and try to move focus by arrow keys, focus still stay on the same button and i only see that ScrollPane scrolling instead.
How can i disable scrolling by arrow keys for ScrollPane and send send that events to my child buttons. I try do some things like:
ScrollPane sp = new ScrollPane() {
@Override
public void requestFocus(){}
};
sp.addEventFilter(KeyEvent.ANY, (event) -> {
if(event.getCode() == KeyCode.DOWN) {
event.consume();
javafx.event.Event.fireEvent(mainGrid, event);
}
});
But unfortunately that have not worked.
What else could i do? Many thanks, Roman