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

FreeBSD Manual Pages

  
 
  

home | help
al_set_mou..._precision(3) Library Functions Manual al_set_mou..._precision(3)

NAME
       al_set_mouse_wheel_precision - Allegro 5	API

SYNOPSIS
	      #include <allegro5/allegro.h>

	      void al_set_mouse_wheel_precision(int precision)

DESCRIPTION
       Sets  the precision of the mouse	wheel (the z and w coordinates).  This
       precision manifests itself as a multiplier on the dz and	dw  fields  in
       mouse  events.	It also	affects	the z and w fields of events and ALLE-
       GRO_MOUSE_STATE(3), but not in a	simple way if you alter	the  precision
       often, so it is suggested to reset those	axes to	0 when you change pre-
       cision.	 Setting  this	to  a  high  value  allows you to detect small
       changes in those	two axes for some high precision mice.	A flexible way
       of using	this precision is to set it to a high  value  (120  is	likely
       sufficient  for most, if	not all, mice) and use a floating point	dz and
       dw like so:

	      al_set_mouse_wheel_precision(120);

	      ALLEGRO_EVENT event;
	      al_wait_for_event(event_queue, &event);
	      if (event.type ==	ALLEGRO_EVENT_MOUSE_AXES) {
		double dz = (double)event.mouse.dz / al_get_mouse_wheel_precision();
		/* Use dz in some way... */
	      }

       Precision is set	to 1 by	default.  It is	impossible  to	set  it	 to  a
       lower precision than that.

SINCE
       5.1.10

SEE ALSO
       al_get_mouse_wheel_precision(3)

Allegro	reference manual			    al_set_mou..._precision(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=al_set_mouse_wheel_precision&sektion=3&manpath=FreeBSD+Ports+14.3.quarterly>

home | help