logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

poll_joystick - Polls the joystick. Allegro game programming library.

Description

       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 */
             poll_joystick();

             /* Process input for the first joystick */
             if (joy[0].button[0].b)
                first_button_pressed();

             if (joy[0].button[1].b)
                second_button_pressed();
             ...
          } while(!done);

Name

       poll_joystick - Polls the joystick. Allegro game programming library.

Return Value

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

See Also

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

Allegro                                           version 4.4.3                           poll_joystick(3alleg4)

Synopsis

#include<allegro.h>intpoll_joystick();

See Also