PurpleKingdomGames / indigo

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

Have a way of discerning click events #703

Closed hobnob closed 2 weeks ago

hobnob commented 9 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 7 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)