diff --git a/app/display/representation-javafx/src/main/java/org/csstudio/display/builder/representation/javafx/widgets/BoolButtonRepresentation.java b/app/display/representation-javafx/src/main/java/org/csstudio/display/builder/representation/javafx/widgets/BoolButtonRepresentation.java index f452184e2c..6fe8000d4f 100644 --- a/app/display/representation-javafx/src/main/java/org/csstudio/display/builder/representation/javafx/widgets/BoolButtonRepresentation.java +++ b/app/display/representation-javafx/src/main/java/org/csstudio/display/builder/representation/javafx/widgets/BoolButtonRepresentation.java @@ -37,6 +37,7 @@ import javafx.scene.control.ButtonBase; import javafx.scene.image.Image; import javafx.scene.image.ImageView; +import javafx.scene.input.MouseButton; import javafx.scene.layout.Pane; import javafx.scene.paint.Color; import javafx.scene.paint.CycleMethod; @@ -117,8 +118,16 @@ public Pane createJFXNode() throws Exception else { final boolean inverted = model_widget.propMode().getValue() == Mode.PUSH_INVERTED; - button.setOnMousePressed(event -> handlePress(! inverted)); - button.setOnMouseReleased(event -> handlePress(inverted)); + button.setOnMousePressed(event -> + { + if (event.getButton() == MouseButton.PRIMARY) + handlePress(! inverted); + }); + button.setOnMouseReleased(event -> + { + if (event.getButton() == MouseButton.PRIMARY) + handlePress(inverted); + }); } }