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 TypeFieldDescriptionint
The flags set for this event.final double
The time at which this event was generated, in milliseconds.Fields inherited from class playn.core.Event
F_PREVENT_DEFAULT
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clearFlag
(int flag) Clears theflag
bit.boolean
Returns true if thealt
key was down when this event was generated.boolean
Returns true if thectrl
key was down when this event was generated.boolean
Returns true if themeta
key was down when this event was generated.boolean
isSet
(int flag) Returns whether theflag
bit is set.boolean
Returns true if theshift
key was down when this event was generated.static int
modifierFlags
(boolean altP, boolean ctrlP, boolean metaP, boolean shiftP) A helper function used by platform input code to compose modifier flags.void
setFlag
(int flag) Sets theflag
bit.toString()
void
updateFlag
(int flag, boolean on) Sets or clearsflag
based 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 thealt
key was down when this event was generated. -
isCtrlDown
public boolean isCtrlDown()Returns true if thectrl
key was down when this event was generated. -
isShiftDown
public boolean isShiftDown()Returns true if theshift
key was down when this event was generated. -
isMetaDown
public boolean isMetaDown()Returns true if themeta
key was down when this event was generated. -
isSet
public boolean isSet(int flag) Returns whether theflag
bit is set. -
setFlag
public void setFlag(int flag) Sets theflag
bit. -
clearFlag
public void clearFlag(int flag) Clears theflag
bit. -
updateFlag
public void updateFlag(int flag, boolean on) Sets or clearsflag
based 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.
-