java.awt.event
public abstract class InputEvent extends ComponentEvent
Since: 1.1
See Also: KeyEvent KeyAdapter MouseEvent MouseAdapter MouseMotionAdapter MouseWheelEvent
UNKNOWN: updated to 1.4
Field Summary | |
---|---|
static int | ALT_DOWN_MASK
The ALT key extended modifier.
|
static int | ALT_GRAPH_DOWN_MASK
The ALT_GRAPH key extended modifier.
|
static int | ALT_GRAPH_MASK
This is the bit mask which indicates the alt-graph modifier is in effect.
|
static int | ALT_MASK
This is the bit mask which indicates the alt key is down. |
static int | BUTTON1_DOWN_MASK
The mouse button1 key extended modifier.
|
static int | BUTTON1_MASK
This bit mask indicates mouse button one is down. |
static int | BUTTON2_DOWN_MASK
The mouse button2 extended modifier.
|
static int | BUTTON2_MASK
This bit mask indicates mouse button two is down. |
static int | BUTTON3_DOWN_MASK
The mouse button3 extended modifier.
|
static int | BUTTON3_MASK
This bit mask indicates mouse button three is down. |
static int | CTRL_DOWN_MASK
The CTRL key extended modifier.
|
static int | CTRL_MASK
This is the bit mask which indicates the control key is down. |
static int | META_DOWN_MASK
The META key extended modifier.
|
static int | META_MASK
This is the bit mask which indicates the meta key is down. |
static int | SHIFT_DOWN_MASK
The SHIFT key extended modifier.
|
static int | SHIFT_MASK
This is the bit mask which indicates the shift key is down. |
Method Summary | |
---|---|
void | consume()
Consumes this event. |
int | getModifiers()
This method returns the old-style modifiers in effect for this event.
|
int | getModifiersEx()
Returns the extended modifiers (new-style) for this event. |
static String | getModifiersExText(int modifiers)
Convert the extended modifier bitmask into a String, such as "Shift" or
"Ctrl+Button1".
|
long | getWhen()
This method returns the timestamp when this event occurred.
|
boolean | isAltDown()
This method tests whether or not the alt key was down during the event.
|
boolean | isAltGraphDown()
This method tests whether or not the alt-graph modifier was in effect
during the event.
|
boolean | isConsumed()
This method tests whether or not this event has been consumed.
|
boolean | isControlDown()
This method tests whether or not the control key was down during the
event.
|
boolean | isMetaDown()
This method tests whether or not the meta key was down during the event.
|
boolean | isShiftDown()
This method tests whether or not the shift key was down during the event.
|
Since: 1.4
Since: 1.4
See Also: ALT_GRAPH_DOWN_MASK
See Also: ALT_DOWN_MASK
Since: 1.4
See Also: BUTTON1_DOWN_MASK
Since: 1.4
See Also: BUTTON2_DOWN_MASK
Since: 1.4
See Also: BUTTON3_DOWN_MASK
Since: 1.4
See Also: CTRL_DOWN_MASK
Since: 1.4
See Also: META_DOWN_MASK
Since: 1.4
See Also: SHIFT_DOWN_MASK
Returns: the modifiers in effect for this event
See Also: getModifiersEx
For an example of checking multiple modifiers, this code will return true only if SHIFT and BUTTON1 were pressed and CTRL was not:
int onmask = InputEvent.SHIFT_DOWN_MASK | InputEvent.BUTTON1_DOWN_MASK; int offmask = InputEvent.CTRL_DOWN_MASK; return (event.getModifiersEx() & (onmask | offmask)) == onmask;
Returns: the bitwise or of all modifiers pressed during the event
Since: 1.4
Parameters: modifiers the modifiers
Returns: a string representation of the modifiers in this bitmask
Since: 1.4
Returns: the timestamp when this event occurred
Returns: true if the alt key is down
Returns: true if the alt-graph modifier is down
Returns: true if this event has been consumed
Returns: true if the control key is down
Returns: true if the meta key is down
Returns: true if the shift key is down