Package io.github.ocelot.window.input
Record Class KeyMods
java.lang.Object
java.lang.Record
io.github.ocelot.window.input.KeyMods
- Record Components:
mods- The raw modifiers bitfieldshift- Whether Left or Right shift is heldcontrol- Whether Left or Right control is heldalt- Whether Left or Right alt is heldsuperKey- Whether the platform super key is held. This is the Windows key on Windows and the super key on Mac.caps- Whether caps lock is activenumLock- Whether num lock is active
public record KeyMods(int mods, boolean shift, boolean control, boolean alt, boolean superKey, boolean caps, boolean numLock)
extends Record
Boolean representations of each key modifier passed from GLFW.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanalt()Returns the value of thealtrecord component.booleancaps()Returns the value of thecapsrecord component.booleancontrol()Returns the value of thecontrolrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intmods()Returns the value of themodsrecord component.booleannumLock()Returns the value of thenumLockrecord component.booleanshift()Returns the value of theshiftrecord component.booleansuperKey()Returns the value of thesuperKeyrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
KeyMods
public KeyMods(int mods) -
KeyMods
public KeyMods(int mods, boolean shift, boolean control, boolean alt, boolean superKey, boolean caps, boolean numLock) Creates an instance of aKeyModsrecord class.- Parameters:
mods- the value for themodsrecord componentshift- the value for theshiftrecord componentcontrol- the value for thecontrolrecord componentalt- the value for thealtrecord componentsuperKey- the value for thesuperKeyrecord componentcaps- the value for thecapsrecord componentnumLock- the value for thenumLockrecord component
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
mods
public int mods()Returns the value of themodsrecord component.- Returns:
- the value of the
modsrecord component
-
shift
public boolean shift()Returns the value of theshiftrecord component.- Returns:
- the value of the
shiftrecord component
-
control
public boolean control()Returns the value of thecontrolrecord component.- Returns:
- the value of the
controlrecord component
-
alt
public boolean alt()Returns the value of thealtrecord component.- Returns:
- the value of the
altrecord component
-
superKey
public boolean superKey()Returns the value of thesuperKeyrecord component.- Returns:
- the value of the
superKeyrecord component
-
caps
public boolean caps()Returns the value of thecapsrecord component.- Returns:
- the value of the
capsrecord component
-
numLock
public boolean numLock()Returns the value of thenumLockrecord component.- Returns:
- the value of the
numLockrecord component
-