Record Class Shortcut
java.lang.Object
java.lang.Record
de.luckymcdev.foundryengine.client.util.key.Shortcut
-
Constructor Summary
ConstructorsConstructorDescriptionShortcut(int key, boolean ctrl, boolean shift, boolean alt) Creates an instance of aShortcutrecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanalt()Returns the value of thealtrecord component.static Shortcutalt(int key) booleanctrl()Returns the value of thectrlrecord component.static Shortcutctrl(int key) static ShortcutctrlAlt(int key) static ShortcutctrlShift(int key) static Shortcutempty()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanReturns true on the frame this shortcut is pressed.intkey()Returns the value of thekeyrecord component.static Shortcutof(int key) booleanshift()Returns the value of theshiftrecord component.static Shortcutshift(int key) toLabel()Formats a human-readable label like "Ctrl+P" for display in menus.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Shortcut
public Shortcut(int key, boolean ctrl, boolean shift, boolean alt) Creates an instance of aShortcutrecord class.- Parameters:
key- the value for thekeyrecord componentctrl- the value for thectrlrecord componentshift- the value for theshiftrecord componentalt- the value for thealtrecord component
-
-
Method Details
-
of
-
ctrl
-
shift
-
alt
-
ctrlShift
-
ctrlAlt
-
empty
-
isPressed
public boolean isPressed()Returns true on the frame this shortcut is pressed. -
toLabel
Formats a human-readable label like "Ctrl+P" for display in menus. -
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
-
ctrl
public boolean ctrl()Returns the value of thectrlrecord component.- Returns:
- the value of the
ctrlrecord component
-
shift
public boolean shift()Returns the value of theshiftrecord component.- Returns:
- the value of the
shiftrecord component
-
alt
public boolean alt()Returns the value of thealtrecord component.- Returns:
- the value of the
altrecord component
-