Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
poll_joystick(3)		Allegro	manual		      poll_joystick(3)

NAME
       poll_joystick - Polls the joystick. Allegro game	programming library.

SYNOPSIS
       #include	<allegro.h>

       int poll_joystick();

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.  Ex-
       ample:

	  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);

RETURN VALUE
       Returns	zero  on  success or a negative	number on failure (usually be-
       cause no	joystick driver	was installed).

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

Allegro				 version 4.4.2		      poll_joystick(3)

NAME | SYNOPSIS | DESCRIPTION | RETURN VALUE | SEE ALSO

Want to link to this manual page? Use this URL:
<https://www.freebsd.org/cgi/man.cgi?query=poll_joystick&sektion=3&manpath=FreeBSD+12.0-RELEASE+and+Ports>

home | help