1poll_keyboard(3)                Allegro manual                poll_keyboard(3)
2
3
4

NAME

6       poll_keyboard - Polls the keyboard. Allegro game programming library.
7

SYNOPSIS

9       #include <allegro.h>
10
11
12       int poll_keyboard();
13

DESCRIPTION

15       Wherever  possible, Allegro will read the keyboard input asynchronously
16       (ie. from inside an interrupt handler), but on some platforms that  may
17       not  be  possible,  in which case you must call this routine at regular
18       intervals to update the keyboard state variables.
19
20       To help you test your keyboard polling code even if you are programming
21       on  a  platform  that doesn't require it, after the first time that you
22       call this function Allegro will switch into polling mode, so from  that
23       point  onwards  you  will have to call this routine in order to get any
24       keyboard input at all, regardless of whether the current  driver  actu‐
25       ally needs to be polled or not.
26
27       The  keypressed(),  readkey(),  and ureadkey() functions call poll_key‐
28       board() automatically, so you only  need  to  use  this  function  when
29       accessing the key[] array and key_shifts variable.
30

RETURN VALUE

32       Returns  zero  on success, or a negative number on failure (ie. no key‐
33       board driver installed).
34
35

SEE ALSO

37       keyboard_needs_poll(3),  install_keyboard(3),  key(3),   key_shifts(3),
38       excamera(3), exsample(3), exstars(3)
39
40
41
42Allegro                          version 4.2.3                poll_keyboard(3)
Impressum