I installed the listener in my panel so that it detects that the left and right mouse buttons are down. But when I hold the left mouse button and then press the right one, the previous action seems to weaken the effect! What I have:
root.setOnMouseDragged(new EventHandler<MouseEvent>(){ @Override public void handle(MouseEvent t) { if(t.getButton() == MouseButton.PRIMARY) f1(); if(t.getButton() == MouseButton.SECONDARY) f2(); } });
holding LMB, I have f1 (), but when I press RMB, it seems that the new event completely overwrites the previous one: only f2 () is fired. How can I separate these two events?
source share