Record Class KeyEvent
java.lang.Object
java.lang.Record
net.minecraft.client.input.KeyEvent
- All Implemented Interfaces:
InputWithModifiers
public record KeyEvent(int key, int keycode, int modifiers)
extends Record
implements InputWithModifiers
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface InputWithModifiers
InputWithModifiers.Modifiers -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionKeyEvent(int key, int keycode, int modifiers) Creates an instance of aKeyEventrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intinput()intkey()Returns the value of thekeyrecord component.intkeycode()Returns the value of thekeycoderecord component.intReturns the value of themodifiersrecord component.intfinal StringtoString()Returns a string representation of this record class.Methods inherited from interface InputWithModifiers
hasAltDown, hasControlDown, hasControlDownWithQuirk, hasShiftDown, isConfirmation, isCopy, isCut, isCycleFocus, isDown, isEscape, isLeft, isPaste, isRight, isSelectAll, isSelection, isUp
-
Field Details
-
key
private final int keyThe field for thekeyrecord component. -
keycode
private final int keycodeThe field for thekeycoderecord component. -
modifiers
private final int modifiersThe field for themodifiersrecord component.
-
-
Constructor Details
-
KeyEvent
public KeyEvent(int key, int keycode, int modifiers) Creates an instance of aKeyEventrecord class.- Parameters:
key- the value for thekeyrecord componentkeycode- the value for thekeycoderecord componentmodifiers- the value for themodifiersrecord component
-
-
Method Details
-
input
public int input()- Specified by:
inputin interfaceInputWithModifiers
-
shortcutKey
public int shortcutKey()- Specified by:
shortcutKeyin interfaceInputWithModifiers
-
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 with thecomparemethod from their corresponding wrapper classes. -
key
public int key()Returns the value of thekeyrecord component.- Returns:
- the value of the
keyrecord component
-
keycode
public int keycode()Returns the value of thekeycoderecord component.- Returns:
- the value of the
keycoderecord component
-
modifiers
public int modifiers()Returns the value of themodifiersrecord component.- Specified by:
modifiersin interfaceInputWithModifiers- Returns:
- the value of the
modifiersrecord component
-