final EventDispatcher initial = textArea.getEventDispatcher();
textArea.setEventDispatcher(new EventDispatcher() {
@Override
public Event dispatchEvent(Event event, EventDispatchChain tail) {
if (event instanceof MouseEvent) {
MouseEvent mouseEvent = (MouseEvent)event;
if (mouseEvent.getButton() == MouseButton.SECONDARY ||
(mouseEvent.getButton() == MouseButton.PRIMARY && mouseEvent.isControlDown())) {
event.consume();
}
}
return initial.dispatchEvent(event, tail);
}