Record Class InputEvent.KeyPressed
java.lang.Object
java.lang.Record
dev.engine.core.input.InputEvent.KeyPressed
- All Implemented Interfaces:
BooleanEvent, DeviceEvent, HasModifiers, InputEvent, KeyEvent
- Enclosing interface:
InputEvent
-
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondevice()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.keyCode()Returns the value of thekeyCoderecord component.Returns the value of themodifiersrecord component.booleanpressed()scanCode()Returns the value of thescanCoderecord component.time()Returns the value of thetimerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
KeyPressed
public KeyPressed(Time time, DeviceId device, KeyCode keyCode, ScanCode scanCode, Modifiers modifiers) Creates an instance of aKeyPressedrecord class.- Parameters:
time- the value for thetimerecord componentdevice- the value for thedevicerecord componentkeyCode- the value for thekeyCoderecord componentscanCode- the value for thescanCoderecord componentmodifiers- the value for themodifiersrecord 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. All components in this record class are compared withObjects::equals(Object,Object). -
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
-
keyCode
-
scanCode
-
modifiers
Returns the value of themodifiersrecord component.- Specified by:
modifiersin interfaceHasModifiers- Returns:
- the value of the
modifiersrecord component
-