class GKeyEvent| Constructor | |
| GKeyEvent() GKeyEvent(e) GKeyEvent(type, key) | Creates a GKeyEvent using the specified parameters or those taken from the more general event e. |
| Methods | |
| getEventType() | Returns the enumerated type constant corresponding to the specific type of key event. |
| getKey() | Returns the integer code associated with the key in the event. |
| getChar() | Returns the character code for the key value after applying modifier keys. |
| toString() | Converts the event to a human-readable representation of the event. |
GKeyEvent(); GKeyEvent(GEvent e); GKeyEvent(KeyEventType type, int key);
GKeyEvent using the specified parameters or
those taken from the more general event e.
Usage:
GKeyEvent keyEvent; GKeyEvent keyEvent(e); GKeyEvent keyEvent(type, key);
KeyEventType getEventType();
Usage:
KeyEventType type = e.getEventType();
int getKey();
Usage:
int key = getKey();
char getChar();
'a' key with
the shift key down, getChar will return 'A'.
If the key code in the event does not correspond to a character,
getChar returns the null character ('\0').
Usage:
char ch = e.getChar();
string toString();
Usage:
string str = e.toString();