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
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. |
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. |
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. |
shift | This field represents the status of the shift key : true => pressed, false => released. |