|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.EventObject
java.awt.AWTEvent
java.awt.event.ComponentEvent
java.awt.event.InputEvent
public abstract class InputEvent
This is the common superclass for all component input classes. These are passed to listeners before the component, so that listeners can consume the event before it does its default behavior.
KeyEvent
,
KeyAdapter
,
MouseEvent
,
MouseAdapter
,
MouseMotionAdapter
,
MouseWheelEvent
,
Serialized FormField 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. |
Fields inherited from class java.awt.event.ComponentEvent |
---|
COMPONENT_FIRST, COMPONENT_HIDDEN, COMPONENT_LAST, COMPONENT_MOVED, COMPONENT_RESIZED, COMPONENT_SHOWN |
Fields inherited from class java.util.EventObject |
---|
source |
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. |
Methods inherited from class java.awt.event.ComponentEvent |
---|
getComponent, paramString |
Methods inherited from class java.awt.AWTEvent |
---|
getID, setSource, toString |
Methods inherited from class java.util.EventObject |
---|
getSource |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int SHIFT_MASK
SHIFT_DOWN_MASK
,
Constant Field Valuespublic static final int CTRL_MASK
CTRL_DOWN_MASK
,
Constant Field Valuespublic static final int META_MASK
META_DOWN_MASK
,
Constant Field Valuespublic static final int ALT_MASK
ALT_DOWN_MASK
,
Constant Field Valuespublic static final int ALT_GRAPH_MASK
ALT_GRAPH_DOWN_MASK
,
Constant Field Valuespublic static final int BUTTON1_MASK
BUTTON1_DOWN_MASK
,
Constant Field Valuespublic static final int BUTTON2_MASK
BUTTON2_DOWN_MASK
,
Constant Field Valuespublic static final int BUTTON3_MASK
BUTTON3_DOWN_MASK
,
Constant Field Valuespublic static final int SHIFT_DOWN_MASK
public static final int CTRL_DOWN_MASK
public static final int META_DOWN_MASK
public static final int ALT_DOWN_MASK
public static final int BUTTON1_DOWN_MASK
public static final int BUTTON2_DOWN_MASK
public static final int BUTTON3_DOWN_MASK
public static final int ALT_GRAPH_DOWN_MASK
Method Detail |
---|
public boolean isShiftDown()
public boolean isControlDown()
public boolean isMetaDown()
public boolean isAltDown()
public boolean isAltGraphDown()
public long getWhen()
public int getModifiers()
getModifiersEx()
public int 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;
public void consume()
consume
in class AWTEvent
public boolean isConsumed()
isConsumed
in class AWTEvent
public static String getModifiersExText(int modifiers)
modifiers
- the modifiers
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |