al_set_mou..._precision(3)
β¨ al_set_mou..._precision β¨
okay so bestie, welcome to the Allegro reference manual entry for al_set_mou..._precision(3) β yes the name is a lil truncated, that's just how the man page shows it, and no I'm not ignoring it, it's literally the title π
π NAME π
al_set_mouse_wheel_precision β Allegro 5 API π¦
πΈ SYNOPSIS πΈ
#include <allegro5/allegro.h>
void al_set_mouse_wheel_precision(int precision)
π DESCRIPTION π
okay so this one sets the precision of the mouse wheel β like the z and w coordinates β¨. And how does that precision show up? It 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 ALLEGRO_MOUSE_STATE(3) β but ngl, not in a simple way if you alter the precision often π. So the move is: it's suggested to reset those axes to 0 when you change precision. Considerate, right? π«Ά
Setting this to a high value lets you detect small changes in those two axes for some high precision mice π. And the flexible way to use this precision? Set it to a high value (and like, 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 π. And heads up β it is impossible to set it to a lower precision than that π. Like, 1 is the floor, periodt.
β SINCE β
5.1.10 π
π SEE ALSO π
al_get_mouse_wheel_precision(3)β the getter bestie, obviously π₯
and that's the whole page, bestie!! πβ¨ this was al_set_mou..._precision(3) from the Allegro reference manual β mwah, go forth and scroll with precision π¦πΈπ
π¦ where this page comes from
- arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms