org.jagatoo.input.devices.components
Class Key
java.lang.Object
org.jagatoo.input.devices.components.DeviceComponent
org.jagatoo.input.devices.components.DigitalDeviceComponent
org.jagatoo.input.devices.components.Key
public class Key
- extends DigitalDeviceComponent
A simple abstraction of a keyboard's key.
|
Constructor Summary |
Key(java.lang.String keyName,
boolean hasKeyChar)
|
| Methods inherited from class org.jagatoo.input.devices.components.DeviceComponent |
bindAction, bindAction, getDeviceComponentID, getLocalizedName, getName, getType, isAnalog, isDigital, notifyBoundActions, unbindAction, unbindAction |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Key
public Key(java.lang.String keyName,
boolean hasKeyChar)
getKeyID
public final KeyID getKeyID()
- Returns:
- this key's key-ID.
getKeyCode
public final int getKeyCode()
- Returns:
- this key's key-code.
Each Key has a unique key-code, that starts at 1 for the
first registered Key.
This is always equal to the KeyID's ordinal + 1.
hasKeyChar
public final boolean hasKeyChar()
- Returns:
- true, if this Key has a printable char.
equals
public boolean equals(java.lang.Object key)
-
- Overrides:
equals in class java.lang.Object
hashCode
public int hashCode()
-
- Overrides:
hashCode in class java.lang.Object
toString
public java.lang.String toString()
-
- Overrides:
toString in class java.lang.Object