2.4.3. Keyboard event structure
This structure contains information about a key pressed/released by the user.
typedef struct {
TCOD_keycode_t vk;
char c;
char text[32];
bool pressed;
bool lalt;
bool lctrl;
bool lmeta;
bool ralt;
bool rctrl;
bool rmeta;
bool shift;
} TCOD_key_t;
Parameter | Description |
---|---|
vk | An arbitrary value representing the physical key on the keyboard. Possible values are stored in the TCOD_keycode_t enum. If no key was pressed, the value is TCODK_NONE |
c | If the key correspond to a printable character, the character is stored in this field. Else, this field contains 0. |
text | If vk is TCODK_TEXT, this will contain the text entered by the user. |
pressed | true if the event is a key pressed, or false for a key released. |
lalt | This field represents the status of the left Alt key : true => pressed, false => released. |
lctrl | This field represents the status of the left Control key : true => pressed, false => released. |
lmeta | This field represents the status of the left Meta (Windows/Command/..) key : true => pressed, false => released. |
ralt | This field represents the status of the right Alt key : true => pressed, false => released. |
rctrl | This field represents the status of the right Control key : true => pressed, false => released. |
rmeta | This field represents the status of the right Meta (Windows/Command/..) key : true => pressed, false => released. |
shift | This field represents the status of the shift key : true => pressed, false => released. |