cljfx 2020-05-15

@hanyuan.work has joined the channel

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

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

i fixed it, thanks for the help!