Package playn.core
Class Event.Input
java.lang.Object
playn.core.Event
playn.core.Event.Input
- Direct Known Subclasses:
Event.XY,Keyboard.Event
- Enclosing class:
Event
The base for all input events.
-
Nested Class Summary
Nested classes/interfaces inherited from class playn.core.Event
Event.Input, Event.XY -
Field Summary
FieldsModifier and TypeFieldDescriptionintThe flags set for this event.final doubleThe time at which this event was generated, in milliseconds.Fields inherited from class playn.core.Event
F_PREVENT_DEFAULT -
Method Summary
Modifier and TypeMethodDescriptionvoidclearFlag(int flag) Clears theflagbit.booleanReturns true if thealtkey was down when this event was generated.booleanReturns true if thectrlkey was down when this event was generated.booleanReturns true if themetakey was down when this event was generated.booleanisSet(int flag) Returns whether theflagbit is set.booleanReturns true if theshiftkey was down when this event was generated.static intmodifierFlags(boolean altP, boolean ctrlP, boolean metaP, boolean shiftP) A helper function used by platform input code to compose modifier flags.voidsetFlag(int flag) Sets theflagbit.toString()voidupdateFlag(int flag, boolean on) Sets or clearsflagbased onon.
-
Field Details
-
flags
public int flags -
time
public final double timeThe time at which this event was generated, in milliseconds. This time's magnitude is not portable (i.e. may not be the same across backends), clients must interpret it as only a monotonically increasing value.
-
-
Method Details
-
isAltDown
public boolean isAltDown()Returns true if thealtkey was down when this event was generated. -
isCtrlDown
public boolean isCtrlDown()Returns true if thectrlkey was down when this event was generated. -
isShiftDown
public boolean isShiftDown()Returns true if theshiftkey was down when this event was generated. -
isMetaDown
public boolean isMetaDown()Returns true if themetakey was down when this event was generated. -
isSet
public boolean isSet(int flag) Returns whether theflagbit is set. -
setFlag
public void setFlag(int flag) Sets theflagbit. -
clearFlag
public void clearFlag(int flag) Clears theflagbit. -
updateFlag
public void updateFlag(int flag, boolean on) Sets or clearsflagbased onon. -
toString
-
modifierFlags
public static int modifierFlags(boolean altP, boolean ctrlP, boolean metaP, boolean shiftP) A helper function used by platform input code to compose modifier flags.
-