poll_joystick man page

poll_joystick — Polls the joystick. Allegro game programming library.


#include <allegro.h>

int poll_joystick();


The joystick handler is not interrupt driven, so you need to call this function every now and again to update the global position values. Example:

   do {
      /* Get joystick input */
      /* Process input for the first joystick */
      if (joy[0].button[0].b)
      if (joy[0].button[1].b)
   } while(!done);

Return Value

Returns zero on success or a negative number on failure (usually because no joystick driver was installed).

See Also

install_joystick(3), joy(3), num_joysticks(3), exjoy(3)

Referenced By

exjoy(3), install_joystick(3), joy(3).

version 4.4.2 Allegro manual