Package playn.core
Class Mouse
java.lang.Object
playn.core.Mouse
Defines and dispatches mouse events.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
The event dispatched for mouse input.static class
A slot which only dispatches onMouse.ButtonEvent
s.static class
The base class for all mouse events.static class
An event dispatched when the mouse is moved.static class
A slot which only dispatches onMouse.MotionEvent
s.static class
An event dispatched when the mouse wheel is scrolled.static class
A slot which only dispatches onMouse.WheelEvent
s. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Mouse.ButtonEvent
buttonEvents
(Mouse.Event event) Checks whetherevent
is aButtonEvent
and returns it (casted appropriately) if so.static Mouse.MotionEvent
motionEvents
(Mouse.Event event) Checks whetherevent
is aMotionEvent
and returns it (casted appropriately) if so.static Mouse.WheelEvent
wheelEvents
(Mouse.Event event) Checks whetherevent
is aWheelEvent
and returns it (casted appropriately) if so.
-
Constructor Details
-
Mouse
public Mouse()
-
-
Method Details
-
buttonEvents
Checks whetherevent
is aButtonEvent
and returns it (casted appropriately) if so. Returnsnull
otherwise. Use it to obtain only button events like so:Input.mouseEvents.collect(Mouse::buttonEvents).connect(event -> { // handle button events here (event has type ButtonEvent) });
-
wheelEvents
Checks whetherevent
is aWheelEvent
and returns it (casted appropriately) if so. Returnsnull
otherwise. Use it to obtain only wheel events like so:Input.mouseEvents.collect(Mouse::wheelEvents).connect(event -> { // handle wheel events here (event has type WheelEvent) });
-
motionEvents
Checks whetherevent
is aMotionEvent
and returns it (casted appropriately) if so. Returnsnull
otherwise. Use it to obtain only motion events like so:Input.mouseEvents.collect(Mouse::motionEvents).connect(event -> { // handle motion events here (event has type MotionEvent) });
-