cljfx

https://github.com/cljfx/cljfx
hanyuone 2020-05-15T08:39:06.105200Z

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

vlaaad 2020-05-15T08:41:16.106200Z

Hi @hanyuan.work! You should use :on-mouse-clicked and then check (.getButton event) in your handler

hanyuone 2020-05-15T08:41:37.107100Z

Thanks, sorry if this question was asked a thousand times already haha

hanyuone 2020-05-15T09:31:11.108100Z

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

hanyuone 2020-05-15T09:34:41.108500Z

I have to do (.getButton (:fx/event event)) right?

vlaaad 2020-05-15T09:38:42.109Z

yes, that’s what I meant

hanyuone 2020-05-15T10:05:39.109600Z

alright

hanyuone 2020-05-15T10:05:53.109900Z

i fixed it, thanks for the help!