SimpleCxxLib packageclass GKeyEvent : public GEventgetKeyChar function is more generally useful and
returns the character after taking into account modifier keys.
The getKeyCode function returns an integer identifying
the key, which can be a function key as well as a standard key.
The codes return by getKeyCode are listed in the
KeyCodes enumeration.
| Constructor | |
Creates a GKeyEvent using the specified parameters. | |
| Methods | |
| Returns the graphics window in which this event occurred. | |
| Returns the character represented by the keystroke, taking the modifier keys into account. | |
| Returns the integer code associated with the key in the event. | |
| Converts the event to a human-readable representation of the event. | |
GKeyEvent(EventType type, const GWindow & gw, int keyChar, int keyCode);
GKeyEvent using the specified parameters.
Usage:
GKeyEvent keyEvent(type, gw, keyChar, keyCode);
GWindow getGWindow() const;
Usage:
GWindow gw = e.getGWindow();
char getKeyChar() const;
'a'
key with the shift key down, getKeyChar will return
'A'. If the key code in the event does not correspond
to a character, getKeyChar returns the null character.
Usage:
char ch = e.getKeyChar();
int getKeyCode() const;
Usage:
int key = getKeyCode();
string toString() const;
Usage:
string str = e.toString();