public class KeyStrokeMap extends Object
KeyStrokeMapping.| Modifier and Type | Method and Description |
|---|---|
static void |
addKeyStrokesFrom(KeyStrokeMappingProvider provider)
Adds the collection of
KeyStrokeMappings from the given KeyStrokeMappingProvider to this map. |
static char |
charFor(KeyStroke keyStroke)
Given a
KeyStroke, returns the equivalent character. |
static void |
clearKeyStrokes()
Removes all the character-
KeyStroke mappings. |
static boolean |
hasKeyStrokes()
Indicates whether
KeyStrokeMap has mappings. |
static KeyStroke |
keyStrokeFor(char character)
Returns the
KeyStroke corresponding to the given character, as best we can guess it, or null if we
don't know how to generate it. |
static void |
reloadFromSystemSettings()
Reloads the key stroke mappings for the language using the current system settings.
|
public static void reloadFromSystemSettings()
public static void addKeyStrokesFrom(@Nonnull KeyStrokeMappingProvider provider)
KeyStrokeMappings from the given KeyStrokeMappingProvider to this map.provider - the given KeyStrokeMappingProvider.public static void clearKeyStrokes()
KeyStroke mappings.public static boolean hasKeyStrokes()
KeyStrokeMap has mappings.true if it has mappings, false otherwise.@Nullable public static KeyStroke keyStrokeFor(char character)
KeyStroke corresponding to the given character, as best we can guess it, or null if we
don't know how to generate it.character - the given character.KeyStroke corresponding to the given character, or null if we cannot
generate it.public static char charFor(@Nonnull KeyStroke keyStroke)
KeyStroke, returns the equivalent character. Key strokes are defined properly for US keyboards
only. To contribute your own, please add them using the method addKeyStrokesFrom(KeyStrokeMappingProvider)
.keyStroke - the given KeyStroke.KeyEvent.VK_UNDEFINED if the result is unknown.Copyright © 2014 AssertJ. All rights reserved.