Package Green
Class InputKey
java.lang.Object
Green.InputKey
A class for storing a key input for (primarily internal) use. It stores both the
char
key
and the int
keyCode
of the input.- Author:
- Zacchary Dempsey-Plante
-
Constructor Summary
ConstructorDescriptionInputKey(char key, int keyCode)
Creates the storage class representing the pressed key. -
Method Summary
Modifier and TypeMethodDescriptionboolean
char
getKey()
Retrieves thechar
representation of the key that was pressed (orPConstants.CODED
if the key doesn't have one)int
Retrieves the keycode of the key that was pressed.int
hashCode()
toString()
-
Constructor Details
-
InputKey
public InputKey(char key, int keyCode)Creates the storage class representing the pressed key.- Parameters:
key
- Thechar
representation of the pressed key.keyCode
- The keyCode of the pressed key.
-
-
Method Details
-
getKey
public char getKey()Retrieves thechar
representation of the key that was pressed (orPConstants.CODED
if the key doesn't have one)- Returns:
- The
char
representation of the key that was pressed (orPConstants.CODED
if the key doesn't have one)
-
getKeyCode
public int getKeyCode()Retrieves the keycode of the key that was pressed.- Returns:
- The keycode of the key that was pressed.
- See Also:
- Java KeyEvent reference
-
hashCode
public int hashCode() -
equals
-
toString
-