libtcoddocumentation

2.4.4. Keyboard event structure

This structure contains information about a key pressed/released by the user.

typedef struct {
    TCOD_keycode_t
vk;
    char
c;
    bool
pressed;
    bool
lalt;
    bool
lctrl;
    bool
ralt;
    bool
rctrl;
    bool
shift;
}
TCOD_key_t;

key.KeyCode
key.Character
key.Pressed
key.LeftAlt
key.LeftControl
key.RightAlt
key.RightControl
key.Shift

ParameterDescription
vkAn 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
cIf the key correspond to a printable character, the character is stored in this field. Else, this field contains 0.
pressedtrue if the event is a key pressed, or false for a key released.
laltThis field represents the status of the left Alt key : true => pressed, false => released.
lctrlThis field represents the status of the left Control key : true => pressed, false => released.
raltThis field represents the status of the right Alt key : true => pressed, false => released.
rctrlThis field represents the status of the right Control key : true => pressed, false => released.
shiftThis field represents the status of the shift key : true => pressed, false => released.