|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.jsxe.gui.KeyEventTranslator
In conjunction with the KeyEventWorkaround, hides some
warts in the AWT key event API.
| Nested Class Summary | |
static class |
KeyEventTranslator.Key
|
| Constructor Summary | |
KeyEventTranslator()
|
|
| Method Summary | |
static void |
addTranslation(KeyEventTranslator.Key key1,
KeyEventTranslator.Key key2)
Adds a keyboard translation. |
static KeyStroke |
getKeyStroke(String keyStroke)
Gets a Swing KeyStroke representing the internal key binding. |
static String |
getModifierString(InputEvent evt)
Returns a string containing symbolic modifier names set in the specified event. |
static char |
getSymbolicModifierName(int mod)
Returns a the symbolic modifier name for the specified Java modifier flag. |
static String |
modifiersToString(int mods)
|
static KeyEventTranslator.Key |
parseKey(String keyStroke)
Converts a string to a keystroke. |
static int |
parseModifiers(String keyStroke)
Parses the keyStroke and returns the InputEvent modifiers |
static void |
setModifierMapping(int c,
int a,
int m,
int s)
Changes the mapping between symbolic modifier key names ( C, A, M, S) and
Java modifier flags. |
static KeyEventTranslator.Key |
translateKeyEvent(KeyEvent evt)
Pass this an event from KeyEventWorkaround.processKeyEvent(java.awt.event.KeyEvent). |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public KeyEventTranslator()
| Method Detail |
public static void addTranslation(KeyEventTranslator.Key key1,
KeyEventTranslator.Key key2)
key1 - Translate this keykey2 - Into this keypublic static KeyEventTranslator.Key translateKeyEvent(KeyEvent evt)
KeyEventWorkaround.processKeyEvent(java.awt.event.KeyEvent).
public static int parseModifiers(String keyStroke)
public static KeyEventTranslator.Key parseKey(String keyStroke)
KeyEvent class, without
the VK_ prefix.
keyStroke - A string description of the key strokepublic static KeyStroke getKeyStroke(String keyStroke)
public static void setModifierMapping(int c,
int a,
int m,
int s)
C, A, M, S) and
Java modifier flags.
You can map more than one Java modifier to a symobolic modifier, for
example :
setModifierMapping(
InputEvent.CTRL_MASK,
InputEvent.ALT_MASK | InputEvent.META_MASK,
0,
InputEvent.SHIFT_MASK);
c - The modifier(s) to map the C modifier toa - The modifier(s) to map the A modifier tom - The modifier(s) to map the M modifier tos - The modifier(s) to map the S modifier topublic static char getSymbolicModifierName(int mod)
mod - A modifier constant from InputEventpublic static String modifiersToString(int mods)
public static String getModifierString(InputEvent evt)
evt - The event
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||