|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.generic.util.KeyStroke
Class KeyStroke represents a key action (after pressing or releasing
a keyboard button) on the keyboard. A KeyStroke can also specify the
modifiers alt, shift, control, meta or any combination
of the four simultaneously pressed. Instances are immutable.
KeyStroke instances are used to define high-level action events and
can automatically initiate actions on the components with which they are registered.
| Field Summary | |
static int |
ALT_GRAPH_MASK
mask for the AltGr-key |
static KeyStroke |
ALT_KEY
keystroke representing the Alt-key |
static int |
ALT_KEY_CODE
Key code for the alt key |
static int |
ALT_MASK
mask for the Alt-key |
static KeyStroke |
CTRL_KEY
keystroke representing the Ctrl-key |
static int |
CTRL_KEY_CODE
Key code for the control key |
static int |
CTRL_MASK
mask for the Ctrl-key |
static int |
META_MASK
mask for the Meta-key |
static int |
NO_MASK
mask, if no modifying key is pressed |
static KeyStroke |
SHIFT_KEY
keystroke representing the Shift-key |
static int |
SHIFT_KEY_CODE
Key code for the shift key |
static int |
SHIFT_MASK
mask for the Shift-key |
| Constructor Summary | |
KeyStroke(char keyChar,
int keyCode,
int modifiers)
Constructor for a KeyStroke. |
|
KeyStroke(char keyChar,
int keyCode,
int modifiers,
boolean onKeyRelease)
Constructor for a KeyStroke. |
|
| Method Summary | |
boolean |
equals(java.lang.Object o)
|
char |
getChar()
Returns the character specified for this KeyStroke instance. |
int |
getCode()
Returns the keyCode specified for this KeyStroke instance. |
int |
getModifiers()
Returns the modifiers specified for this KeyStroke instance. |
int |
hashCode()
|
boolean |
isOnKeyRelease()
Returns true, if this keystroke should trigger the action if the key is released and not if the key is pressed |
java.lang.String |
toString()
|
static java.lang.String |
toStringModifiers(int modifiers)
Returns a textual representation for the given modifiers. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int NO_MASK
public static final int SHIFT_MASK
public static final int CTRL_MASK
public static final int META_MASK
public static final int ALT_MASK
public static final int ALT_GRAPH_MASK
public static final int SHIFT_KEY_CODE
public static final int ALT_KEY_CODE
public static final int CTRL_KEY_CODE
public static final KeyStroke SHIFT_KEY
public static final KeyStroke CTRL_KEY
public static final KeyStroke ALT_KEY
| Constructor Detail |
public KeyStroke(char keyChar,
int keyCode,
int modifiers)
keyChar - the char of the key.keyCode - an int specifying the numeric code for a key.modifiers - an int specifying any combination of the
key modifiers. Have a look at the corresponding constants.
public KeyStroke(char keyChar,
int keyCode,
int modifiers,
boolean onKeyRelease)
keyChar - the char of the key.keyCode - an int specifying the numeric code for a key.modifiers - an int specifying any combination of the
key modifiers. Have a look at the corresponding constants.onKeyRelease - A flag specifying whether this keystroke should trigger
an action on pressed or released event| Method Detail |
public final char getChar()
KeyStroke instance.
char value of this KeyStroke.public final int getCode()
KeyStroke instance.
int value for the keyCode.public final int getModifiers()
KeyStroke instance.
int value for modifiers.public static final java.lang.String toStringModifiers(int modifiers)
modifiers - an int specifying key modifiers.
public final boolean equals(java.lang.Object o)
public int hashCode()
public final java.lang.String toString()
public boolean isOnKeyRelease()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||