Record Class InputEvent.MousePressed
java.lang.Object
java.lang.Record
dev.engine.core.input.InputEvent.MousePressed
- All Implemented Interfaces:
BooleanEvent, DeviceEvent, HasModifiers, InputEvent, MouseButtonEvent
- Enclosing interface:
InputEvent
public static record InputEvent.MousePressed(Time time, DeviceId device, MouseButton button, Modifiers modifiers, double x, double y)
extends Record
implements MouseButtonEvent
-
Nested Class Summary
Nested classes/interfaces inherited from interface InputEvent
InputEvent.CharTyped, InputEvent.CursorMoved, InputEvent.DeviceConnectionChanged, InputEvent.GamepadAxisMoved, InputEvent.GamepadPressed, InputEvent.GamepadReleased, InputEvent.KeyPressed, InputEvent.KeyReleased, InputEvent.KeyRepeated, InputEvent.MousePressed, InputEvent.MouseReleased, InputEvent.Scrolled -
Constructor Summary
ConstructorsConstructorDescriptionMousePressed(Time time, DeviceId device, MouseButton button, Modifiers modifiers, double x, double y) Creates an instance of aMousePressedrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbutton()Returns the value of thebuttonrecord component.device()Returns the value of thedevicerecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of themodifiersrecord component.booleanpressed()time()Returns the value of thetimerecord component.final StringtoString()Returns a string representation of this record class.doublex()Returns the value of thexrecord component.doubley()Returns the value of theyrecord component.Methods inherited from interface MouseButtonEvent
source
-
Constructor Details
-
MousePressed
public MousePressed(Time time, DeviceId device, MouseButton button, Modifiers modifiers, double x, double y) Creates an instance of aMousePressedrecord class.- Parameters:
time- the value for thetimerecord componentdevice- the value for thedevicerecord componentbutton- the value for thebuttonrecord componentmodifiers- the value for themodifiersrecord componentx- the value for thexrecord componenty- the value for theyrecord component
-
-
Method Details
-
pressed
public boolean pressed()- Specified by:
pressedin interfaceBooleanEvent
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
time
Returns the value of thetimerecord component.- Specified by:
timein interfaceInputEvent- Returns:
- the value of the
timerecord component
-
device
Returns the value of thedevicerecord component.- Specified by:
devicein interfaceDeviceEvent- Returns:
- the value of the
devicerecord component
-
button
Returns the value of thebuttonrecord component.- Specified by:
buttonin interfaceMouseButtonEvent- Returns:
- the value of the
buttonrecord component
-
modifiers
Returns the value of themodifiersrecord component.- Specified by:
modifiersin interfaceHasModifiers- Returns:
- the value of the
modifiersrecord component
-
x
public double x()Returns the value of thexrecord component.- Specified by:
xin interfaceMouseButtonEvent- Returns:
- the value of the
xrecord component
-
y
public double y()Returns the value of theyrecord component.- Specified by:
yin interfaceMouseButtonEvent- Returns:
- the value of the
yrecord component
-