Hi, how do I detect right clicks for buttons? I'm making a Minesweeper clone and I want a button to fire two separate actions depending on left-click or right-click
Hi @hanyuan.work! You should use :on-mouse-clicked
and then check (.getButton event)
in your handler
https://openjfx.io/javadoc/14/javafx.graphics/javafx/scene/input/MouseEvent.html#getButton()
Thanks, sorry if this question was asked a thousand times already haha
I ran into a problem with using (.getButton event)
in a case
@vlaaad: java.lang.IllegalArgumentException: No matching field found: getButton for class clojure.lang.PersistentArrayMap
I have to do (.getButton (:fx/event event))
right?
yes, that’s what I meant
alright
i fixed it, thanks for the help!