public class Mouse
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Mouse.ButtonEvent
The event dispatched for mouse input.
|
static class |
Mouse.ButtonSlot
A slot which only dispatches on
Mouse.ButtonEvents. |
static class |
Mouse.Event
The base class for all mouse events.
|
static class |
Mouse.MotionEvent
An event dispatched when the mouse is moved.
|
static class |
Mouse.MotionSlot
A slot which only dispatches on
Mouse.MotionEvents. |
static class |
Mouse.WheelEvent
An event dispatched when the mouse wheel is scrolled.
|
static class |
Mouse.WheelSlot
A slot which only dispatches on
Mouse.WheelEvents. |
| Constructor and Description |
|---|
Mouse() |
| Modifier and Type | Method and Description |
|---|---|
static Mouse.ButtonEvent |
buttonEvents(Mouse.Event event)
Checks whether
event is a ButtonEvent and returns it (casted appropriately) if
so. |
static Mouse.MotionEvent |
motionEvents(Mouse.Event event)
Checks whether
event is a MotionEvent and returns it (casted appropriately) if
so. |
static Mouse.WheelEvent |
wheelEvents(Mouse.Event event)
Checks whether
event is a WheelEvent and returns it (casted appropriately) if
so. |
public static Mouse.ButtonEvent buttonEvents(Mouse.Event event)
event is a ButtonEvent and returns it (casted appropriately) if
so. Returns null 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)
});
public static Mouse.WheelEvent wheelEvents(Mouse.Event event)
event is a WheelEvent and returns it (casted appropriately) if
so. Returns null 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)
});
public static Mouse.MotionEvent motionEvents(Mouse.Event event)
event is a MotionEvent and returns it (casted appropriately) if
so. Returns null 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)
});
Copyright © 2018. All Rights Reserved.