.\" Generated by the Allegro makedoc utility .TH calibrate_joystick 3alleg4 "version 4.4.2" "Allegro" "Allegro manual" .SH NAME calibrate_joystick \- Calibrates the specified joystick. Allegro game programming library.\& .SH SYNOPSIS .B #include .sp .B int calibrate_joystick(int n); .SH DESCRIPTION Most joysticks need to be calibrated before they can provide full analogue input. This function performs the next operation in the calibration series for the specified stick, assuming that the joystick has been positioned in the manner described by a previous call to calibrate_joystick_name(), returning zero on success. For example, a simple routine to fully calibrate all the joysticks might look like: .nf int i; for (i=0; i<;num_joysticks; i++) { while (joy[i].flags & JOYFLAG_CALIBRATE) { char *msg = calibrate_joystick_name(i); textprintf_ex(..., "%s, and press a key\\n", msg); readkey(); if (calibrate_joystick(i) != 0) { textprintf_ex(..., "oops!\\n"); readkey(); exit(1); } } } .fi .SH "RETURN VALUE" Returns zero on success, non-zero if the calibration could not be performed successfully. .SH SEE ALSO .BR install_joystick (3alleg4), .BR calibrate_joystick_name (3alleg4), .BR joy (3alleg4), .BR num_joysticks (3alleg4), .BR exjoy (3alleg4)