public class TICInputEvent extends EventObject
source
Constructor and Description |
---|
TICInputEvent(TICComponent source,
long time,
int modifiers)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
static long |
convertSWTEventTime(int time)
Converts a SWT event time value to a Swing time value.
|
static int |
convertSWTStateMask(int stateMask,
int mouseButton) |
int |
getModifiers() |
TICComponent |
getSource() |
long |
getTime() |
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.
|
toString
public TICInputEvent(TICComponent source, long time, int modifiers)
source
- the TIC component triggering this eventtime
- the time (in milliseconds) when the event happenedmodifiers
- the modifier keys in AWT format (see constants in KeyEvent
)public static long convertSWTEventTime(int time)
time
- the SWT time value (unsigned int
)long
)public static int convertSWTStateMask(int stateMask, int mouseButton)
public TICComponent getSource()
getSource
in class EventObject
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
.