#include "gevents.h"

class GKeyEvent

This event subclass represents a key event.
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.

Constructor detail


GKeyEvent();
GKeyEvent(GEvent e);
GKeyEvent(KeyEventType type, int key);
Creates a GKeyEvent using the specified parameters or those taken from the more general event e.

Usage:

GKeyEvent keyEvent;
GKeyEvent keyEvent(e);
GKeyEvent keyEvent(type, key);

Method detail


KeyEventType getEventType();
Returns the enumerated type constant corresponding to the specific type of key event.

Usage:

KeyEventType type = e.getEventType();

int getKey();
Returns the integer code associated with the key in the event.

Usage:

int key = getKey();

char getChar();
Returns the character code for the key value after applying modifier keys. For example, if the user types the '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();
Converts the event to a human-readable representation of the event.

Usage:

string str = e.toString();