|
NAMEkey - Array of flags indicating key state. Allegro game programming library. SYNOPSIS#include <allegro.h> extern volatile char key[KEY_MAX]; DESCRIPTIONArray of flags indicating the state of each key, ordered by scancode. Wherever possible these values will be updated asynchronously, but if keyboard_needs_poll() returns TRUE, you must manually call poll_keyboard() to update them with the current input state. The scancodes are defined in allegro/keyboard.h as a series of KEY_* constants (and are also listed below). For example, you could write:
Note that the array is supposed to represent which keys are physically held down and which keys are not, so it is semantically read-only. These are the keyboard scancodes:
Finally, you may notice an `odd' behaviour of the KEY_PAUSE key. This key only generates an interrupt when it is pressed, not when it is released. For this reason, Allegro pretends the pause key is a `state' key, which is the only way to make it usable. SEE ALSOinstall_keyboard(3), poll_keyboard(3), key_shifts(3)
|