Record ALLEGRO_KEYBOARD_EVENT

Hierarchy
Methods
Properties

Unit

Declaration

type ALLEGRO_KEYBOARD_EVENT = record

Description

Contains the keyboard events information.

See also
ALLEGRO_EVENT
An ALLEGRO_EVENT is an union of all builtin event structures, i.e.

Overview

Fields

ftype: ALLEGRO_EVENT_TYPE;
source: ALLEGRO_KEYBOARDptr;
timestamp: AL_DOUBLE;
display: ALLEGRO_DISPLAYptr;
keycode: AL_INT;
unichar: AL_INT;
modifiers: AL_UINT;
frepeat: AL_BOOL;

Description

Fields

ftype: ALLEGRO_EVENT_TYPE;

Indicates the type of event.

source: ALLEGRO_KEYBOARDptr;

The keyboard which generated the event.

timestamp: AL_DOUBLE;

When the event was generated.

display: ALLEGRO_DISPLAYptr;

The display which had keyboard focus when the event occurred.

keycode: AL_INT;

The code corresponding to the physical key which was pressed or released. See the Keyboard section for the list of ALLEGRO_KEY_* constants.

unichar: AL_INT;

A Unicode code point (character). This may be zero or negative if the event was generated for a non-visible "character", such as an arrow or Function key. In that case you can act upon the keycode field.

Some special keys will set the unichar field to their standard ASCII values: Tab=9, Return=13, Escape=27. In addition if you press the Control key together with A to Z the unichar field will have the values 1 to 26. For example Ctrl-A will set unichar to 1 and Ctrl-H will set it to 8.

As of Allegro 5.0.2 there are some inconsistencies in the treatment of Backspace (8 or 127) and Delete (127 or 0) keys on different platforms. These can be worked around by checking the keycode field.

modifiers: AL_UINT;

This is a bitfield of the modifier keys which were pressed when the event occurred. See modifier flags for the constants.

frepeat: AL_BOOL;

Indicates if this is a repeated character.


Generated by PasDoc 0.15.0. Generated on 2024-11-10 15:15:06.