java.lang.Object com.realtime.crossfire.jxclient.gui.keybindings.KeyCodeMap
public class KeyCodeMap
Maps between key codes integer constants and string representations.
Field Summary | |
---|---|
private java.util.Map<java.lang.String,java.lang.Integer> |
keyCodes
Maps key name to key code. |
private java.util.Map<java.lang.Integer,java.lang.String> |
keyNames
Maps key code to key name. |
Constructor Summary | |
---|---|
KeyCodeMap()
Creates a new instance. |
Method Summary | |
---|---|
int |
getKeyCode(java.lang.String keyName)
Returns the key code for a key name. |
java.lang.String |
getKeyName(int keyCode)
Returns the key name for a key code. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@NotNull private final java.util.Map<java.lang.String,java.lang.Integer> keyCodes
@NotNull private final java.util.Map<java.lang.Integer,java.lang.String> keyNames
Constructor Detail |
---|
public KeyCodeMap()
Method Detail |
---|
public int getKeyCode(@NotNull java.lang.String keyName) throws NoSuchKeyCodeException
keyName
- the key name to convert
NoSuchKeyCodeException
- if the key name is invalid@NotNull public java.lang.String getKeyName(int keyCode)
keyCode
- the key code to convert