PurpleKingdomGames / indigo

An FP game engine for Scala.
https://indigoengine.io/
MIT License
611 stars 56 forks source link

Have a way of discerning click events #703

Open hobnob opened 4 months ago

hobnob commented 4 months ago

At the moment click events only fire on a left mouse click, with no way to discern a right click from any other click event. We should fire the click event when a right or left click happen, allow discerning which button was clicked, and allow any pointer device clicks.

davesmith00000 commented 2 months ago

I've had a look into this, two things:

  1. There is no Right click, but we could latch onto the contextmenu event, what do you think?
  2. There is a workaround. You can listen for pointer events, like this:
    case c @ PointerEvent.PointerUp(_) =>
      println(c.button) // Tells you which button was released, e.g. : `RightMouseButton`
      Outcome(viewModel)