public class TICInputEvent extends TICEvent
Constructor and Description |
---|
TICInputEvent(TICComponent source,
int id,
long time,
int modifiers)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
TICInputEvent |
clone() |
TICInputEvent |
cloneWithNewSource(TICComponent source)
Creates a copy of this event with all properties set to identical values but with a
different source.
|
boolean |
equals(java.lang.Object obj) |
int |
getID() |
int |
getModifiers() |
long |
getTime() |
int |
hashCode() |
boolean |
isAltDown()
Determines whether the alt button was pressed during this event.
|
boolean |
isAltGraphDown()
Determines whether the alt graph button was pressed during this event.
|
boolean |
isControlDown()
Determines whether a control button was pressed during this event.
|
boolean |
isMenuShortcutKeyDown()
Tests whether the menu shortcut key is pressed (Command on Mac and Control on the other OS).
|
boolean |
isMetaDown()
Determines platform independent whether a meta button was pressed during this event.
|
boolean |
isMouseButton1Down()
Determines whether mouse button 1 was pressed during this event.
|
boolean |
isMouseButton2Down()
Determines whether mouse button 2 was pressed during this event.
|
boolean |
isMouseButton3Down()
Determines whether mouse button 3 was pressed during this event.
|
boolean |
isShiftDown()
Determines whether a shift button was pressed during this event.
|
public TICInputEvent(TICComponent source, int id, long time, int modifiers)
source
- the TIC component triggering this eventid
- the AWT ID identifying the event (e.g. KeyEvent.KEY_RELEASED
or MouseEvent.MOUSE_CLICKED
)time
- the time (in milliseconds) when the event happenedmodifiers
- the modifier keys in AWT format (see constants in KeyEvent
)public int getID()
public long getTime()
public int getModifiers()
public boolean isShiftDown()
true
if the button was pressed while this event happened, false otherwise
.public boolean isControlDown()
true
if the button was pressed while this event happened, false otherwise
.public boolean isAltDown()
true
if the button was pressed while this event happened, false otherwise
.public boolean isAltGraphDown()
Note that in the current implementation this method will always return false
if this event was triggered
by a SWT component.
true
if the button was pressed while this event happened, false otherwise
.public boolean isMetaDown()
Note that in the current implementation this method will always return false
if this event was triggered
by a SWT component.
true
if the button was pressed while this event happened, false otherwise
.public boolean isMouseButton1Down()
true
if the button was pressed while this event happened, false otherwise
.public boolean isMouseButton2Down()
true
if the button was pressed while this event happened, false otherwise
.public boolean isMouseButton3Down()
true
if the button was pressed while this event happened, false otherwise
.public boolean isMenuShortcutKeyDown()
true
if the button was pressed while this event happened, false otherwise
.public TICInputEvent cloneWithNewSource(TICComponent source)
TICEvent
cloneWithNewSource
in class TICEvent
source
- the source component to be used for the created copypublic TICInputEvent clone()