From 4ec7cd746a569ba8da64f7a202482909aef4caac Mon Sep 17 00:00:00 2001 From: Abraham Wolk Date: Mon, 20 Jul 2026 09:32:02 +0200 Subject: [PATCH] CSSTUDIO-3780 Bugfix: Boolean Button in "Push"/"Push (inverted)" mode only writes to the PV when left-clicking. --- .../javafx/widgets/BoolButtonRepresentation.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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); + }); } }