Interface IKeyLookup
- All Known Implementing Classes:
SWTKeyLookup
public interface IKeyLookup
A facilitiy for converting the formal representation for key strokes (i.e., used in persistence) into real key stroke instances.
- Since:
- 3.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe formal name of the 'Alt' key.static final StringThe formal name of the 'Arrow Down' key.static final StringThe formal name of the 'Arrow Left' key.static final StringThe formal name of the 'Arrow Right' key.static final StringThe formal name of the 'Arrow Up' key.static final StringAn alternate name for the backspace key.static final StringThe formal name for the 'Break' key.static final StringThe formal name of the backspace key.static final StringThe formal name for the 'Caps Lock' key.static final StringThe formal name of the 'Command' key.static final StringThe formal name of the carriage return (U+000D)static final StringThe formal name of the 'Ctrl' key.static final StringThe formal name of the delete (U+007F) keystatic final StringAn alternative name for the delete key.static final StringThe formal name of the 'End' key.static final StringAn alternative name for the enter key.static final StringThe formal name of the escape (U+001B) key.static final StringAn alternative name for the escape key.static final StringThe formal name of the 'F1' key.static final StringThe formal name of the 'F10' key.static final StringThe formal name of the 'F11' key.static final StringThe formal name of the 'F12' key.static final StringThe formal name of the 'F13' key.static final StringThe formal name of the 'F14' key.static final StringThe formal name of the 'F15' key.static final StringThe formal name of the 'F16' key.static final StringThe formal name of the 'F17' key.static final StringThe formal name of the 'F18' key.static final StringThe formal name of the 'F19' key.static final StringThe formal name of the 'F2' key.static final StringThe formal name of the 'F20' key.static final StringThe formal name of the 'F3' key.static final StringThe formal name of the 'F4' key.static final StringThe formal name of the 'F5' key.static final StringThe formal name of the 'F6' key.static final StringThe formal name of the 'F7' key.static final StringThe formal name of the 'F8' key.static final StringThe formal name of the 'F9' key.static final StringThe formal name of the form feed (U+000C) key.static final StringThe formal name of the 'Home' key.static final StringThe formal name of the 'Insert' key.static final StringThe formal name of the line feed (U+000A) key.static final StringThe formal name of the 'M1' key.static final StringThe formal name of the 'M2' key.static final StringThe formal name of the 'M3' key.static final StringThe formal name of the 'M4' key.static final StringThe formal name of the null (U+0000) key.static final StringThe formal name of the 'NumLock' key.static final StringThe formal name of the '0' key on the numpad.static final StringThe formal name of the '1' key on the numpad.static final StringThe formal name of the '2' key on the numpad.static final StringThe formal name of the '3' key on the numpad.static final StringThe formal name of the '4' key on the numpad.static final StringThe formal name of the '5' key on the numpad.static final StringThe formal name of the '6' key on the numpad.static final StringThe formal name of the '7' key on the numpad.static final StringThe formal name of the '8' key on the numpad.static final StringThe formal name of the '9' key on the numpad.static final StringThe formal name of the 'Add' key on the numpad.static final StringThe formal name of the 'Decimal' key on the numpad.static final StringThe formal name of the 'Divide' key on the numpad.static final StringThe formal name of the 'Enter' key on the numpad.static final StringThe formal name of the '=' key on the numpad.static final StringThe formal name of the 'Multiply' key on the numpad.static final StringThe formal name of the 'Subtract' key on the numpad.static final StringThe formal name of the 'Page Down' key.static final StringThe formal name of the 'Page Up' key.static final StringThe formal name for the 'Pause' key.static final StringThe formal name for the 'Print Screen' key.static final StringAn alternative name for the enter key.static final StringThe formal name for the 'Scroll Lock' key.static final StringThe formal name of the 'Shift' key.static final StringThe formal name of the space (U+0020) key.static final StringThe formal name of the tab (U+0009) key.static final StringThe formal name of the vertical tab (U+000B) key. -
Method Summary
Modifier and TypeMethodDescriptionintformalKeyLookup(String name) Looks up a single natural key by its formal name, and returns the integer representation for this natural keyformalKeyLookupInteger(String name) Looks up a single natural key by its formal name, and returns the integer representation for this natural keyintformalModifierLookup(String name) Looks up a single modifier key by its formal name, and returns the integer representation for this modifier keyformalNameLookup(int key) Looks up a key value, and returns the formal string representation for that keyintgetAlt()Returns the integer representation of the ALT key.intReturns the integer representation of the COMMAND key.intgetCtrl()Returns the integer representation of the CTRL key.intgetShift()Returns the integer representation of the SHIFT key.booleanisModifierKey(int key) Returns whether the given key is a modifier key.
-
Field Details
-
ALT_NAME
-
ARROW_DOWN_NAME
-
ARROW_LEFT_NAME
-
ARROW_RIGHT_NAME
-
ARROW_UP_NAME
-
BACKSPACE_NAME
-
BREAK_NAME
-
BS_NAME
-
CAPS_LOCK_NAME
-
COMMAND_NAME
-
CR_NAME
-
CTRL_NAME
-
DEL_NAME
-
DELETE_NAME
-
END_NAME
-
ENTER_NAME
-
ESC_NAME
-
ESCAPE_NAME
-
F1_NAME
-
F10_NAME
-
F11_NAME
-
F12_NAME
-
F13_NAME
-
F14_NAME
-
F15_NAME
-
F16_NAME
-
F17_NAME
-
F18_NAME
-
F19_NAME
-
F20_NAME
-
F2_NAME
-
F3_NAME
-
F4_NAME
-
F5_NAME
-
F6_NAME
-
F7_NAME
-
F8_NAME
-
F9_NAME
-
FF_NAME
-
HOME_NAME
-
INSERT_NAME
-
LF_NAME
-
M1_NAME
-
M2_NAME
-
M3_NAME
-
M4_NAME
-
NUL_NAME
-
NUM_LOCK_NAME
-
NUMPAD_0_NAME
-
NUMPAD_1_NAME
-
NUMPAD_2_NAME
-
NUMPAD_3_NAME
-
NUMPAD_4_NAME
-
NUMPAD_5_NAME
-
NUMPAD_6_NAME
-
NUMPAD_7_NAME
-
NUMPAD_8_NAME
-
NUMPAD_9_NAME
-
NUMPAD_ADD_NAME
-
NUMPAD_DECIMAL_NAME
The formal name of the 'Decimal' key on the numpad.- See Also:
-
NUMPAD_DIVIDE_NAME
-
NUMPAD_ENTER_NAME
-
NUMPAD_EQUAL_NAME
-
NUMPAD_MULTIPLY_NAME
The formal name of the 'Multiply' key on the numpad.- See Also:
-
NUMPAD_SUBTRACT_NAME
The formal name of the 'Subtract' key on the numpad.- See Also:
-
PAGE_DOWN_NAME
-
PAGE_UP_NAME
-
PAUSE_NAME
-
PRINT_SCREEN_NAME
-
RETURN_NAME
-
SCROLL_LOCK_NAME
-
SHIFT_NAME
-
SPACE_NAME
-
TAB_NAME
-
VT_NAME
-
-
Method Details
-
formalKeyLookup
Looks up a single natural key by its formal name, and returns the integer representation for this natural key- Parameters:
name- The formal name of the natural key to look-up; must not benull.- Returns:
- The integer representation of this key. If the natural key cannot
be found, then this method returns
0.
-
formalKeyLookupInteger
Looks up a single natural key by its formal name, and returns the integer representation for this natural key- Parameters:
name- The formal name of the natural key to look-up; must not benull.- Returns:
- The integer representation of this key. If the natural key cannot
be found, then this method returns
0.
-
formalModifierLookup
Looks up a single modifier key by its formal name, and returns the integer representation for this modifier key- Parameters:
name- The formal name of the modifier key to look-up; must not benull.- Returns:
- The integer representation of this key. If the modifier key
cannot be found, then this method returns
0.
-
formalNameLookup
Looks up a key value, and returns the formal string representation for that key- Parameters:
key- The key to look-up.- Returns:
- The formal string representation of this key. If this key cannot be found, then it is simply the character corresponding to that integer value.
-
getAlt
int getAlt()Returns the integer representation of the ALT key.- Returns:
- The ALT key
-
getCommand
int getCommand()Returns the integer representation of the COMMAND key.- Returns:
- The COMMAND key
-
getCtrl
int getCtrl()Returns the integer representation of the CTRL key.- Returns:
- The CTRL key
-
getShift
int getShift()Returns the integer representation of the SHIFT key.- Returns:
- The SHIFT key
-
isModifierKey
boolean isModifierKey(int key) Returns whether the given key is a modifier key.- Parameters:
key- The integer value of the key to check.- Returns:
trueif the key is one of the modifier keys;falseotherwise.
-