Package playn.scene

Class Mouse.Listener

java.lang.Object
react.Slot<Object>
playn.scene.Mouse.Listener
All Implemented Interfaces:
Reactor.RListener, SignalView.Listener<Object>, ValueView.Listener<Object>
Enclosing class:
Mouse

public abstract static class Mouse.Listener extends Slot<Object>
A listener for mouse button, motion and wheel events with layer info.
  • Constructor Details

    • Listener

      public Listener()
  • Method Details

    • onMotion

      public void onMotion(Mouse.MotionEvent event, Mouse.Interaction iact)
      Notifies listener of a mouse motion event. A motion event is dispatched when no button is currently pressed, in an isolated "one shot" interaction, and always goes to the layer hit by the event coordinates.
    • onHover

      public void onHover(Mouse.HoverEvent event, Mouse.Interaction iact)
      Notifies listener of mouse entry or exit. Hover events are dispatched in an isolated "one shot" interaction, regardless of whether there is currently a button-triggered interaction in progress, and always got to the layer whose hover status changed.
    • onButton

      public void onButton(Mouse.ButtonEvent event, Mouse.Interaction iact)
      Notifies listener of a mouse button event. A button down event will start an interaction if no interaction is already in progress, or will be dispatched to the hit layer of the current interaction if an interaction is in progress. If additional buttons are pressed during an interaction, the interaction does not end until all of the buttons are released.
    • onDrag

      public void onDrag(Mouse.MotionEvent event, Mouse.Interaction iact)
      Notifies listener of a mouse drag event. A drag event is dispatched when a button event has started an interaction, and always goes to the layer hit by the button event that started the interaction, not to the layer intersected by the motion event coordinates.
    • onWheel

      public void onWheel(Mouse.WheelEvent event, Mouse.Interaction iact)
      Notifies listener of a mouse wheel event. If no interaction is in progress, the wheel event is dispatched to the layer intersected by the event coordinates, but if an interaction is in progress, the event goes to the layer hit by the event that started the interaction.
    • onCancel

      public void onCancel()
      Notifies the listener that the current interaction was canceled. This is dispatched when some other layer that was also privy to this interaction has captured the interaction.
    • onEmit

      public final void onEmit(Object event)